openapi: 3.0.3
info:
  contact:
    email: apiteam@peachfinance.com
  description: >
    # Introduction

    This API is organized around
    [REST](https://en.wikipedia.org/wiki/Representational_state_transfer).


    Our API has predictable resource-oriented URLs, accepts form-encoded request
    bodies, returns JSON-encoded responses,

    and uses standard HTTP response codes, authentication, and verbs.


    You can use the API in test mode, which does not affect your live data. The
    API key you use to authenticate the

    request determines whether the request is in live mode or test mode.


    # Versioning


    This API is versioned. For more information see [API Versioning
    Docs](https://docs.peachfinance.com/api-versioning).

    For a list of available versions—and the breaking changes associated with
    them—see

    [Breaking Changes](https://docs.peachfinance.com/api-docs/breaking-changes).
    (Requires Docs Hub login.)


    # Pagination

    Peach Finance API utilizes cursor-based pagination via the `startingAfter`

    and `endingBefore` parameters. Both parameters take an existing Object ID

    value and return objects in reverse chronological order. The `endingBefore`

    parameter returns objects listed before the named object. The
    `startingAfter`

    parameter returns objects listed after the named object. If both parameters

    are provided, only `endingBefore` is used.


    The size of the page can be limited using the `limit` parameter.

    `limit` is optional; the default is 25 and can be between 1 and 100.

    Sending both `startingBefore` and `endingAfter` is not currently supported.


    Some endpoints will allow sending a `sortBy` parameter, enumerating the
    fields that can be used to

    sort the results returned by that particular endpoint. For example, if the
    results can be sorted by

    `createdAt` and `updatedAt`, then sending `sortBy=[updatedAt, -createdAt]`
    will return the results sorted

    by `updatedAt` in ascending order and `createdAt` in descending order
    lexicographically.


    # Metadata

    Some Peach objects have a `metaData` attribute. You can use this attribute
    to pass

    key-value data as part of an object.


    Metadata can be used when you need to store additional information on an
    object. Metadata

    is not used by Peach. It is stored as part of an object and returned to you.


    Do not store any personal identifiable information (such as SSN) as
    metadata. Use dedicated

    attributes for PII as these attributes are encrypted.


    Note: Metadata attribute can hold up to 50 keys, with key names up to 100
    characters long and values

    up to 500 characters long.


    # Attributes Formats

    Some Peach attributes use common formats.

    1. **Interest rate, promo rate and APR** - Rates are annual. Format is
    decimal. For example, 0.005 is 0.5% annual rate, 0.01 is 1% annual rate, 0.2
    is 20% annual rate.

    2. **Dates** - Dates are in format `YYYY-MM-DD`. Dates are computed relative
    to either
        - the company timezone, which is configured on the company config, or
        - the product timezone, which is configured on the Loan Type.  Note: it is possible for a company to have multiple products with different timezones.
    3. **Date-times** - Timestamps are in ISO-8601 format expressed either in
    UTC like `2001-01-01T12:00:00Z` or with UTC offset like
        `2001-01-01T12:00:00-07:00`. Some date-times will include subsecond precision to an arbitrary number of digits like `2001-01-01T12:00:00.123Z`.
    4. **Amount** - Amounts are in decimal format with 2 places after the
    decimal point. For example, 32.45 is thirty-two dollars and forty-five
    cents.


    # Identifiers

    Peach objects always have unique identifiers created by Peach. Some objects
    support external IDs. If external ID is supported, the object will have
    `externalId` attribute. You can fetch objects using external ID (only
    objects that support external IDs).

    Peach IDs have the same format XX-YYYY-YYYY.


    XX - is a prefix from the list below.


    YYYY-YYYY - is a random set of numbers and letters (capital characters A-Z
    and digits 1-9). The digit zero is not used to avoid confusion with capital
    letter O.


    ## External IDs

    External IDs allows avoiding the need to map IDs between your system and
    Peach. You can pass your IDs when creating various objects at Peach and then
    use the same IDs to fetch

    the information back.


    When fetching data with external IDs or when sending a request that requires
    a reference to an object using its external ID (for example, inside a body
    of a POST request), there is

    a need to add a `ext-` in front of the ID. This will make sure Peach knows
    these are external IDs being used.


    For example, fetching a borrower using the external ID would look like `GET
    /api/people/ext-MY_EXTERNAL_BORROWER_ID`.


    When creating objects with external IDs, the `ext-` prefix is not needed.

    For example, when creating a new borrower the body would look like:

    ```

    POST /api/people

    {
      "externalId" : "MY_EXTERNAL_BORROWER_ID"
      ...
    }

    ```


    ## List of Prefixes


    | Prefix | Object |

    | --- | ----------- |

    | UR | User |

    | BO | Borrower |

    | BN | Person Name |

    | BI | Person Identity |

    | CT | Contact |

    | LT | Loan Type |

    | IR | Investor |

    | LN | Loan |

    | LN | Loan Draw |

    | LA | Installment Advances |

    | CP | Company |

    | TX | Transaction |

    | EV | Event |

    | EM | Event Message |

    | PT | Payment Instrument |

    | PA | Payment ID |

    | DD | Document Descriptor |

    | FT | Fee Type |

    | MS | Person Monitoring Status |

    | CS | Case |

    | CE | Case Type |

    | AP | Autopay |

    | IN | Interaction |

    | DT | Do Not Interact Type |

    | DN | Do Not Interact |

    | NT | Notification Type |

    | NO | Notification |

    | TD | Template Descriptor |

    | TV | Template Version |

    | CO | Code |

    | CR | Compliance Rule |

    | SR | Service |

    | FD | FEMA Disaster Details |

    | NT | Note |

    | CN | Consent |

    | LR | Legal Representative |

    | RL | Role |

    | PM | Permission |

    | WT | Workflow Type |

    | ST | Workflow Step Type |

    | IT | Workflow Item Type |

    | WF | Workflow |

    | WS | Workflow Step |

    | WI | Workflow Workitem |

    | VT | Verification Type |

    | VE | Verification |

    | VA | Verification Attempt |

    | OB | Obligation |

    | RE | Repayment Notification Descriptor  |

    | LP | Loan People |

    | RA | InterestRate |

    | PE | Period (loan)  |

    | IA | Loan Investor Association |

    | SE | Settlement |

    | RF | Loan Refund |

    | SM | Statement |

    | SA | Statement Activity |

    | SD | Statement Draw Info |

    | LF | Loan Fee |

    | AE | Autopay Expected Payment |

    | FE | FEMA Disaster |

    | TY | Loan Tape Type |

    | TA | Loan Tape |

    | MR | Merchant |

    | LS | Loan Reporting Status |

    | CA | Credit Agency |

    | CL | Collection Agency |

    | CI | Card Issuer |

    | WH | Webhook |

    | AF | ACHFile Upload Monitoring |

    | FB | Funding Account Balance |

    | BC | Borrower Campaign |

    | RN | Campaign Run |

    | CX | Contact  Exporter|

    | TC | Transaction Chargeback |

    | PS | Promise to Pay Plan |

    | P2 | Promise to Pay Period |

    | LL | Loan Label |

    | AK | API Key    |

    | AT | AI Call Transcription Result |

    | SU | AI Call Summary Result |

    | RC | Rate Cap |


    # Events

    Our system supports pull events via our REST API.

    You can see more information <a href="/api-docs/api-public/events">here</a>.


    # Compliance Guard

    Compliance Guard covers core regulatory obligations related to servicing and

    collections. It does not cover rules required for debt collection agencies

    (though some of them are applicable to creditors and servicers as a best

    practice.)


    Compliance Guard allows you to:
      - Run real-time regulatory checks before initiating an outbound communication
      with a borrower. Rules cover laws on the federal level and 50 states + DC. The
      system runs appropriate rules based on loan type, loan status, location of a borrower,
      borrower status, and past communications.
      - Monitor for bankruptcy, deceased, active military, and FEMA (disasters). You can
      monitor for all four or any combination of the four. On hits, we automatically create "cases"
      with all details, block future outbound communications (if needed), and notify
      you about the cases.

    ## Configuring Compliance Guard

    - Peach will configure an appropriate loan type for you. It allows us to
    select a

    predefined set of regulatory rules

    - Peach will work with you to override regulatory rules based on your risk
    appetite. You

    can "mute" rules. You can add rules. This is typically done with your legal

    and compliance teams.

    - Peach will work with you to add business rules based on your needs. For
    example, don't

    allow outbound debt collection calls on Sundays. This is typically done with
    your

    operations and product teams.


    ## Implementing Compliance Guard in your system

    - You need to create borrower and loan objects in the Peach system. For more
    details

    see <a href="/api-docs/api-public/borrowers">Borrower Management</a> and <a
    href="/api-docs/api-public/loans">Loans Management</a>.

    - You need to report all communications with a borrower. Not required for
    monitoring.

    This way Peach can track all interactions with the borrower. For more
    details see

    <a href="/api-docs/api-public/communicator">Communicator & Interactions</a>.

    - When sending a communication through Peach it will automatically check
    Compliance
      Guard rules to determiend if the communication is compliant. If it is not compliant,
      the communication will not be rejected. (Some send endpoints do not perform
      Compliance Guard checks, but they should be clearly marked.)
    - You can also manually check if a communication is compliant by using the
      <a href="/api-docs/api-public/compliance-guard/peach.people.handlers.can_interact">Can interact</a> endpoint.

    # Locks

    Peach ensures consistency of the loan's ledger and balances. In order to
    make sure that

    multiple operations are not writing to the ledger at the same time, Peach
    uses locks to protect

    the consistency of the loan.


    In situations where an API call affects a loan's ledger, the system will
    lock the

    loan to protect its consistency. Subsequent calls that affect that loan's
    ledger might

    return a `423 Locked` status if the loan is still locked. In these cases,
    you can make

    a call to <a
    href="/api-docs/api-public/loans/peach.people.loans.handlers.get_lock_status">Lock
    Status</a>

    to check if the loan is still locked.


    If you are trying to make a call and get `423 Locked`, consider polling on
    the <a
    href="/api-docs/api-public/loans/peach.people.loans.handlers.get_lock_status">Lock
    Status</a>

    to check when the lock is released. Most locks are short.

    Some API calls (e.g. retroactive interest adjustment or payment backdate)

    can trigger a loan replay. Loan replays can last several minutes, during
    which the loan will

    be locked.


    # Sync calls

    Most of the API endpoints are asynchronous by design. There are situations
    in which you

    might want to wait until the API call/operation finishes. Some API endpoints
    have

    a special query parameter called `sync`.


    For example:

    - <a
    href="/api-docs/api-public/payment-instruments/peach.payment_instruments.handlers.person_payment_instrument_create">Create
    Payment Instrument</a>

    - <a
    href="/api-docs/api-public/line-of-credit-purchases/peach.people.loans.purchases.handlers.draw_purchases_create">Create
    Purchase</a>


    When `sync=true`, the call will be blocked until the async operation has
    finished.

    If the operation takes too long, you will get a `408 Request Timeout`
    response.

    In that case, you need to poll on that specific operations' result.

    For example: if you make a call to add a Payment Instrument, and it times
    out, you can poll

    the `/payment-instruments` endpoint to see if the new payment instrument has
    been added.


    # Errors


    **BETA** - Standardization of error response bodies is in progress.


    Peach uses conventional HTTP response codes to indicate the success or
    failure of an API request.

    In general, codes in the 2xx range indicate success, codes in the 4xx range
    indicate an error that

    resulted from the provided information (e.g., a required parameter was
    missing), and codes in the 5xx

    range indicate an error with the Peach service.

    Error response bodies have the following JSON format:

    ```json

    {
        "statusCode": 400,
        "message": "A description of the error.",
        "errorType": "TheErrorType"
    }

    ```

    For a list of error types, see the <a
    href="/api-docs/api-public/errors">Errors</a> section.
  license:
    name: Proprietary
    url: https://www.peachfinance.com/terms-of-use
  termsOfService: https://www.peachfinance.com/terms-of-use
  title: Peach Finance API
  version: '2023-11-29'
  x-logo:
    altText: Peach Finance
    backgroundColor: '#FFFFFF'
    url: >
      data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA1wAAAE0CAYAAAA43TLaAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAC+FSURBVHgB7d3PbltXtufxtQ/txHYKKPaggZukgZBxzU0Pbl2nJ6GewMrgom13AMtPYEqpeaR5ItFPYBpI20bXIPITmJl0OVWDMPNyeAJcJwXcwWUBlVhJmWf13iTlP7L+i/ucffb5fgDHf2NLlESe31lrr2UkQsPOx+3MjBfdj5NabbP52Rd9AQAAAICcGYnM45VrS0b09o5fTlWSW0k23mx276cCAAAAADmILnB9t3J1aL9r7PkHVPpqzJ0ky/qELwAAAAA+xRi49Ah/fFPFPDi/frcnAAAAADBnVQ9c21Ijpi9JcofzXgAAAADmhcD1ulRVHiSqXVoOAQAAAJwEgWs/Rgaq5hbnvQAAAAAcB4HrsJ4P2/h5s9ndHAkAAAAAHIDAdWRmZB+0Tc57AQAAADgIgetkpsM2MrnV7N4dCAAAAAC8hMA1PyxXBgAAAPAKApcPLFcGAAAAIASuPGxmRu787vN7mwIAAACgUghc+WG5MgAAAFAxBK5isFwZAAAAqAACV9FYrgwAAABEi8AVktmwjfPrd3sCAAAAoPQIXEFiuTIAAAAQAwJX+FiuDAAAAJQUgatcWK4MAAAAlAiBq6w47wUAAAAEj8BVckZMT7Kfl5vdzZEAAAAACMopQamp6JIm59wPbwgAAACAoCSC0jM2dA3/8HFbAAAAAASFwBWLLLsuAAAAAIJC4IqEirYFAAAAQFAIXAAAAADgCYELAAAAADwhcAEAAACAJwQuAAAAAPCEwAUAAAAAnhC4AAAAAMATAhcAAAAAeELgAgAAAABPCFwAAAAA4AmBCwAAAAA8IXABAAAAgCcELgAAAADwhMAFAAAAAJ4QuAAAAADAEwIXAAAAAHgSYeAyIwEAAACAAEQXuIzRgQAAAABAAOKrcI11TQAAAAAgANEFrmb3fl+F0AUAAACgeFEOzTi/fn+V0AUAAACgaNFOKXShy2TatMHrhqhwrgsAAABA7oxUxLBzpaHGrNr3+EP704bEJ31//V5TAAAAAASjMoHrZTZ8tW34WhJjLotoXeJA4AIAAAACU8nA9bLHK1eWEkkuq+iilBuBCwAAAAhM5QPXNtdymCXSToy5riptKR8CFwAAABAYAtcuJuHLmI4xclnKc96LwAUAAAAEhsB1gBfnvYIftkHgAgAAAAJD4DqCYefqohpZtI/adQkPgQsAAAAIDIHrGAI970XgAgAAAAJD4DqhSfgSs2gSuSnFthwSuAAAAIDAELjmaNi51lKjnYLOexG4AAAAgMAQuDx5adhGXue9CFwAAABAYAhcng07i/UsObOYw3kvAhcAAAAQGAJXjraHbRgxn8r8Ww4JXAAAAEBgCFwF8XDei8AFAAAABIbAFYA5nfcicAEAAACBIXAF5ITnvQhcAAAAQGAIXIE68n4vNYP3N+5eFAAAAADBIHCVwEsth3ue9zJies31uzcEAAAAQDAIXCUz7FxdlMRcV9HF57+okhrVhWb3fioAAAAAgkHgKinXcmg/fK3pz572m93NkQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIlhEEZdhZrIuca4xr2jBq7I/dN60nIu+531f7Y/uf+qH+MiMjI2aUqf5djBnZX0nV6KhmaiN59ixtdu+nAgAAAMAbAlcBtkNVlkhLVFvGTMJUaztcSZ6MDCSTkYp8a0PZIEmSVJ79Y9Dsbo4EAAAAwIkQuDybhqvftLJEW4noBVuhattfbkjobBCzFbZBJubbJNN+s3t3IAAAAACOhMA1Z88Dlhkv2gf3gq0atXKvWnnhWhK1r5J8RQADAAAADofANQfDzpVGltQWjWaX4wlYB0qNmL4kyZ3mZ1/0BQAAAMBrCFzHNOx83JYk+1BFl6QMLYJemZH9RNocG33wu8/vbQoAAACACQLXEQw711qSyGVC1r6ofAEAAAAzBK4DuDNZWfLW0rRdUNqCo0hVzFqSZX1G0AMAAKCKCFx7cC2Dk8EXxlyvyJksj6Yth5JlawQvAAAAVAmBawcXtNSMP6Wa5YcR06PdEAAAAFVB4JLZKPfk3E3OZuVIpW9qtTWCFwAAAGJW6cD1ImhJh7bBghC8AAAAELFKBi6CVngmrYac8QIAAEBkKhe4Hq9cWzKinwqtg0EieAEAACAmlQlcDMMolck4+fPrd3sCAAAAlFj0gcu1D47N2W5i5LqgbFKT6QLVLgAAAJRVIhEbfnLtpibnhoSt0mpoYobDlWufCgAAAFBCUVa4hp1rLTW6QftgVKh2AQAAoHSiq3C5aogm+g1hKzpUuwAAAFA60VS4hp0rjSyRTSPmgiB2VLsAAABQClFUuKZntZJvCFuV4apdD92IfwEAAAACVuoK12yB8W0VXRRUkg3Zq831u2sCAAAABKi0gWsyGCPRL4UFxlDpG9UbtBgCAAAgNKVsKZy2EMpDIWzBMdJ2LYbuHJ8AAAAAASldhWu4cnVDRToCvC412bOPmt0/DgQAAAAIQGkClzuvpebsl4x7x0FsIF8+v36vKwAAAEDBShG4XKuYaxkTWghxSAzTAAAAQAiCP8M1HY5B2MLRqOgqS5IBAABQtKAD118/ubrIcAwcF6ELAAAARQu2pfD7T65eH6v0BDgh2gsBAABQlCArXG7sO2EL80KlCwAAAEUJLnANV658qqpMmMNcEboAAABQhKBaCidhS8yqAJ7QXggAAIA8BRO4CFvIS01l6b2Ne3cEAAAA8CyIwMWADOTNJLWF5mdf9AUAAADwqPDA5Ua/JypfCpCvkcn0YrN7PxUAAADAk0ID17BzpaFJ8o2I1gXIX2qypzZ0bY4EAAAA8KCwKYXTsGUeErZQoIaas1RXAQAA4E0hFa5hZ7GuyVlb2ZKG4DBSI2aQqX4vKqkkZpRkWbr9e7v8+cb0O1PPEuMCbcMm6/fEaEPVtAi5rzKSdJvr/2dZAAAAgDkrJnCtXN1QkY7gdSoD+9h8JcYMbKjq+zhj5AKvyJlWliRtG8Qu2H+vXfUQlhn56Hef39sUAAAAYI5yD1yMf9/JjFT1TqLSF3naL+o80bBzrZWJtpOaXFZ1AaxyGKIBAACAucs1cA07H7c1GT+UytsOWbppL/D7Ehh3vi5LpJ0Yc71S4cuG3vc37i0IAAAAMCe5Ba4XQzIqfG7LXtAb1bUQQ9ZeZuFryYi5LhX42HGeCwAAAPOUW+D6bvnqQ/uvtaVybDVLsltJttUt+/jxxytXlqpQ9WIpMgAAAOYll8BVzXNb8QStnWzVqy0182nEwYv9XAAAAJgL74Fr1ko4lMqIN2jt5IKXGrNhP4taEhlaCwEAADAPXgNX1fZtGTGbkmXLVZt051oN7fv+qUT2caa1EAAAACeViE/J2eguwnelrgVNF5rrdz+q4ljx8+v3e++v32uq6JpERMfjTwUAAAA4AW8VrqqMgFeVW4k+XeW8z1Rs0yhVZPn8+r2uAAAAAMfgJXBVopXQVbVUb5RpxHueHq9cWZ21GZbdyGRPmwRqAAAAHIeflsLYWwkn+7TcFDvC1l7Or99fNZm5aH+YSrnVJXmL1kIAAAAcy9wrXLFPJVQxa+fX764KDsV9PkjN3C77CHmTPbMB+48DAQAAAI5g7hWu2fmdCJlRZsYfEbaOxg0RaX5+b6HsAzXUnNoQAAAA4IjmGrger1xbkhhbCSdTCGXhd5//303BsbgWw1KHLiPt4R8+bgsAAABwBHMLXK51zIjGd9ZlOhxjodm9SzvZCU3PdekNKSnGxAMAAOCo5lfhSsxNia269TxsVW+3li/2seyVNnRR5QIAAMARzSVwTQZliHQkJoQtb2aha0FKiCoXAAAAjmIuUwr/uny1lxi5LrEgbOXCBvUlTcxtKRmT1Baan33RFwAAMHeN1qWG+/7ZrHNqLKaeiNbdj81L62ZO2R+P5MxoNOizKxNBO3Hgim4MPGErV6UMXSr99zfulbJCBwBACOqtdv0t+akhkrTtN9cp9Z59gW3JsY+nmIERtcHLfCuSpcb+/B9yZkAYQwhOHrhWrn2poosSBTMyWXaRsJWvxytXVu0TY6la9ahyHezd1qWHGvMC9NfY54/Ji/1Ean/+d/vcOFL7op/Is/TJ4C9RDt75F3snOhGJdB1I/uzn0K0ng6+7AnmndcndzG2INzr6YfD1fxPkwgWs38hWyz4n2mtGvWBfH9qSCxfE5KtMpP9U3uxXIYDZrx03VfuCeGIfy4W/DR6lUmKz5xcvXBX2yeDRKzfmT8kJ2OpEO56w5ZbbZh8RtvLnphf+dflqo0xtqdl47D7v+4I9zcJWQypD3fv8ys8dM/n1mntydz+zoUsnL/5j+/lT9heslzQEc2EvRusCd8Nmyf8NG1N/u/X7xR8Hf2bliycvQpZcV3m6mE0+v1Xype7fb9nn3ZvnZEveal3q21+8E9lz8Cvs+/rbat3wPJaGeLLbZ/jJhmbUylWV2I99kVuzYasvKERN3+zYD0JpKgDGhsNhZ5ELIxzRpF3GXUjetk++Q3eH7d3WB913W//aEgDP2a+RXK4vEkluCubuf7Qutd1z2zl5OrTVENftsCSB3ExwlbWXnoNvu7dVAM+OHbgmZ7c0r3KwX0ZM7/z63VVBYZrd3siofuTasqQc6llyLq7JnChCw9a/btoK2DfvtD74xt3VF6DiZhfADcmBu/jmgnt+pkHr0sNpyNKboYSsfSy5t3V684vnX/hz7MA1NmZVYqCSSvbzsqBwrp2zTDu6bJXrsgBzM2l7uc0LP6our+pWUf9ejF4NWqW8Gd/g+Rc+HStwuepWLGPgpxMJN5lgE4hm996mrZzekjJQbbEIGR7wwo/KckNY8r5gd/+eO2skOLIIgtZOPP/Ci2MFrliqW7NzW6kgKIm+uSov7dkI2Wx4BuDD9gv/7X+Z7aQBYmdEVqUA52SLFvEjcAH13dYHGxEFrZ0mz78uTPL8i3k4cuCKprqlknJuK0yT81wlaS1keAZysOTGrvOij9i5z3EbuAq6vtCbVLkOx1W1bED9RkWjD6kuTM6Ga9B2ihM5cuDKkqQtEXCthIJguYmRJWktrMup3zBhDr41EtFv3m59QEUV0apN9jMVxdSpch1su6ol1Rs5vvpO64MvufGF4zpy4DKipU/5biohrYThm7YWlmBqYZZFcZ4RoTN1+/z75butS3y+IUrTqXaF4mtrDy5oTJfZx1/V2psu0m2A4zpS4HKLjqXsdzUmUwmzNUHwXGuhShZ8lcst/6atEHlRkR5jrBGb2YCChhSrwdfW69yewCTes1pHRbcBjuVIgWtszJKUnKoyKKNEzq/fX5XwB2jQVohcZbbSxV1WxCSU0eyMiH+VC6AqSRVbCPcx7TZ4u/VvtKDi0A4duKIYluEGZXTv9wSlYitIwVckmVaIfJm6u+PMIX/EIM9FxwdhEfILrn15el4r+OXFhTBiNhimgcM6dOCKYViGq24JSsdWuXrGSF8CZiLZS4dSaZyVp7zYo/TsRX1QlYKMs1yTsOXalwUHWeVcLQ7j0IHLmMIPs54M1a1Sy1TvSNjqw86/01aIXNk7rB3uxqPMZq2xlyUsS1WuHrvzSYStw+NcLQ7jUIHLtRPaz6hSX0xS3So3V+UKfWJhlpxqC5AzzpygzIpadHyQqo6In+5Cy24LjoRztTjIoQJXlphyn0+x1a1EtjYFpRb6xEKjwd2lRQVw5gRlVeyi44NUbxGy+3gknNk6Js7VYn+HClxlP59ijOk3u5vh73PCvpLsTDfoKpcpdxUY5UWVC2VUC3rMuKmfladLUiH2gtDdmG4IjotztdjTgYErhnZC9m7Fwe3lMkYHEi7OcaEQrsrFnVWUTeg3CsKtvs3fbNreBcGJcK4Wezl10B9w7YRGSkylz96teGRq7hjRtgRqdo4r5FCISLkzJ6NAz8PMQSoVYZ/fKtGN4RYda/DVFNNyF8//MXjUl4hNl/jqqmAuMpHb9gbYxdGgT2cVnjswcCVGLqtKaWn40+1wBEn2xqYmv27Yj2yQd/MTMdwhzIm9EdSXIJi6StYo/tyDujOEqxKf9IfBo6YgMubmpMYVuFkVri+Rmp6j0w0Jho5slWhgH/evzORGy3hwWmqjdPAofflPuYr+W/KTfdtr9vlXW/bVt2H/3wsaRptqI/IbYDiGfQPXsLNUV/2lLSWWRPxEWUWurXD4ydWBvQnQlgBpwNW3yKRPBo8WJCDuAuA3stXKpi/4rhWpIbkyLXfx9LcdFyZAaFzVKJtcJIdveyhNrFWu2ZTIhhTKhazEda9s/sfg6/5h/g9XPRq96CZ5/v9Mg9iWG/R2vdjwpTft83GP52Ns2/cM17hW7rBFO2GcMpUHEq7GsLPIWZoKchcA7qLMVmNWXUXGPrm6QJhKjsIeQgBMjUWWpERUSj6peQ/FT4mctM+u/Sxnm08Gf+rMI9S652F7M67nbsjZm19NG7oK6nKaTC1kgAae239oRialfpJRE/SFOY4pyTTwEf+nG4LKm4Uv1wqX29Aee3HxoQABC3sU/O5UsusxDqWZjoAvwoug5W5Q+Trr5KpLPw4eLbng5doUJX9LDNDAtn0DV2LK/eKdZM/6gujMqpapBCpLTjOpEM+5CwrJLXSVo00L1RXqouP9mXpsi5Dd0BIpppXw20zMRZ9BaycXvGwF7aINXcuS81CabHJWEdgncE3GwZd5H4NK2uz+kWlxsVL5SkKlXPTiVe7iIqchHw0BAjUb0FDSBfFxLUIuYiS/DTy3fpYz7aLONdnQ1XVhT3K9YauLrOyAs2fgGtdMqS8a3bJjQbTUhDt63V5QNATYweRS5TJ1d1ErQICmZwyLnuZ5XGZ7GEPpFVTdWnPntIoele7C3huydTHPFsPYqqM4nr1bCkt+fivLsnArIDixoNtFDaPh8Tp3piuPKtdYxtxNRZD8VlXc2V7v7WKxLELO+/1Ym7VWByEdDEbTFsO8BmoobYXYO3AlSbk3jicypp0wYtN2URPqUkEueLEH86149obUaGlFcHxXVf4p2ZobLS4ebY+IlxJzb3/O49KDClsvezJ4tJRPq7epMzwDuwYut3/LPrOU+UV7xPmtCjCaSpjqszOQwCsyGfcFqCZvVRV30fyfg7+4m3A98UxLPuo735H8uhlq2Np2WrY+khzOdGWs7Ki8PSpcW+W+Q6rhnu/BHGXivVpwfLR14XWJnEoFqJgcqiqTytaTwf8b+K5YuPejrOckG61WPcehJWk2mQoYNtdeaC+Eb4h3ZR0Wg3nZNXBlSekHZqSC6IU8OGMspxoC7DCWzHsbrDKpEIHxXFVJ3aLb7Z/kMZwmKdni5m3/lDOLeQ0tcSGmqGmERzU9X2tuiVemxbTCaju12y+qSssYKa1MNODKB+bHneFSCZFJyjqJCwDmx/ei450By108v9u61PdbUZuMiO8WPXHvqOxjktcwtJ77OEiJuAmKjdalrnj0s6DKdg1ctUTe0zCvYw9Fs3CX4mJ+kuyfA01OSaAaAuxQk6SurpvfI815sSewH9+Ljse7thDqA/svt8Wb6SLkUfmWOOfS1pbltuh9vtKSVORQTru2FKqWu6WwdqrGBUclBPxxVqXChdcYybx/XiThTu9ExUzPDMmH4k9vt7a10/JLz/+I+HKN+s5xSl6vLK2EQJ5eC1zDzr/bsFXyi8Vnz1JB9Jrd+6kEKjHmtwLskMekqiyHc2LAYUzPDPmr9u9VSXGDEMT/mZxSjfpWMbm0E5a1ugX4tkuFq1b6O/MhX4hj7lIBSsKI8d7SU5OEwIUgeB6h/mC/SsobsuX1PI5TshHxPiuN26huAXt47QCMm1BY4nkZQBBUtSHAS9zd8EzUe7v2LzKOLHBpfbY0tyLGgyeTnVLl5j5mPidm2rvF+wYqV+V6p3XpgXg8t7S9CDn0ARGutfPXHJ57ktl4fgCve33igNonyHInrlRQGcZIqsqACoQvE7ktOfjPCC7WX2XqmtNjF4aaa8mK4WPobTKhlR4m5LhQlnkeFJGJcWe5+hKwZ3Imj3P5adkmEwJ5ei1wqWjDlDxxAUBI7J1213rUEO+Upe8o3Lut/9lSydriyWF3beU0In7R7VcKeUS8Tqpb3q/r+oLKsDczhvZ1TXB4r53hqiUc9geAeZmFrVXJhflegIJlknXEn1cWHR/Evi2eh2eIuBHxErSkIZ7RTgjs77XARXsWAJycO9th764/lBx39dh72JsCFMj3omM5YiXlx8GfN/MYEe+qXBIsvSCe/UPOUF0H9rHb1tiGAACOzF10vSVbbvzy9TxGwO/0q4y56EGhfC86Pt7Y8cmIeI8TBU39rDxdGh0wyKMo6v26Tgcht1QCIXglcA07S3WVXwQAwqb1d1qXViUAxl5s2bfnt9NzIlsNlcKk8Q3MQNkUsej4IG5E/K/y5k2ZfK36YabDM4IMXOI9cNHKDBxkR4Xrp8buRa9SKf0eMQAHmVw4BbEDR6XAiPWqvgAFymEU/LHOCbkR8e+2Prhjv1Zvij+NEEfEuxZP8Y8bPcABdpzhKv/SYyFwVQpnDoGp47VaAfPjdxGwDk4SZoyo9/ONIS5Crkni/ZpIJSNwAQdIJELDziKhqzJMkB9rY0wqQE6MrW4dp9UKmJe3W793Zxcb4omZnsM6NhfWjOcq8PYiZAmIkcz7a6QNdZzfAg7wSuDKEv+jQ/NxhsBVGcrHGmAkMwqWSOKzXe9Io+D3YnKoAmd+JzQG6RcZE7iAA+yocMVx8ToWk8dWdRRs2Pn3YD/O9kWXQ8TIy1wuRoHjcueEfC4XnldQmrUkpuLVdBGyBGKcS4WrRuACDrAjcIXZnnVUJonj/cBBQj5zqLwAIRcqZlmAAvkeBT+eYyugEfW8CNnUQ1qEnORwhgvAwaI8wyWqVLgqIEtCrmQaAhfy0Ptx8CeWHaMwOSw67s3zfOJp+aXHImQAeXs1cGkcLYX2DlZDEL+AJxQmSZIK4FfKZEIUrTbdP+XNvD/H3Yh4OeEAjoNNFyFLADLJuPkHBOCVwGViGaluzAVB9JJEwv04P/uFFzl4ZWT8EZMJUTQVXRRPfE3fdIuQxbNEzGUJQB4TBMcyppoHHCDOlkKRBqPh46cabkths/tH9pLAG3uRu/xk8Bc+x1Aot+hYPI6Ct9UZL5UoV+Wq4oh4X06JaQiAfcUauOwdl7NtQbSmEwqDbYGlugWf1n4cfO39Dj1wEM+LftMfB3/2dj4xjxHxISxCfuZ9KiODOYDDiDZwGeNvRC2KlyWnwx2YoULlAb6s/TB4tCpAwWbVm4Z44jsQ5bUI+b+3/rXQ16ozspXDDUBW8QAHiTdwScDne3BiqtqWQBljUgHmSl0L1A3CFkLhu7r1k5zJY/qm94Xhb8ipJSnQdEiI36mMyqAy4ECnJFa2wuXOcTW7m7R3RSgx8qEEKhP9VoD5SY1kH1X4zFYqOVwYhyLxXHWZB9+Ljq3+aND3/tp9WrY2f5U3N3zuIFXJrtdb7dU83p+9TdaUeGz702Bfj4FQxBu4nFO/cWXuviAqw84V92LfkEAlSY2WQsyFEXPrJ3mz4Iu1YtnKXvqEyl5QfC86zmvdgav+vNO65AZzeKzWTRchjzw/ZgdwNwEb4o2puxDO1FRgb1EHrmw8duNq+4KoZIlZNBKwZ89SAU5gerZkzCRCBKdsi44P4kbE2yrXTZ9VLrcIWQoMXPbGTaquCdTrvzFZD8Awn+pIpfwakqNXApcakxrPX5R5MmbyotARRCUxclnD/TQdNbv3UwGOwQUtNyzAHegXIEA1MYs+L96TnNtHXZXr3dYHd3Qaijwx9bdbv1/0OXVxf+r9xs1s7xiBqyJ+GDxqSom5G0f2uWYoOYp2aMZMffiHj9uCaEzaCTXgCZRMKMTRpfbb2s9y5r89GTxaIGwhZH6DiaRFfP7bG83eg1Aiic/HbV/jHDp93Jm+eqvNeHhgD3Gf4RLaCmOTJUk75CqsrRJ/JcC+3MRBM7CfxV+5AQkELJSFW3Ts+fxs453Wpdyf4DPxb3sRchFf765F853Wv438tk2KnJWnSyOqXMCudgauVCLj2gqHncVVphXGwYatwhdJ7idJkr4AL6SuncdI8r29rLM/zvo/yVtplYdgoLxCWORbZrPHry+FmNwMvCwe0VYI7C36CpdVz5KzS8KTQOkNO1faIU8nnHj2D1oKc2EGieiyBEZlPDottdFIzowIVYiJq85koT//Bm677a6I5wZ7s7Kv00DkTZFVPCB0O4Zm6MjEMzPjOfs+cdclAmNjloI+dKhmQCU1H/biYcSLOpCfjAFUc1HUiPixmE37+rkhnhVbxQPC9cr1a20c6ThrtwSZ4Rml5oZlJMbrKOITU1HObwGIjpvoJZ7b0apDbxYxXGI2aj8Vz1yV6+3WB4sC4BU7Wgpr0d6d1/GYuy4lZqtbq6GP1ExqtYJG/gKAP6bYpb2RKXQRshu57/0cnhHdsKGyX6a2andToeb5sRmLrLEcurp2BK4z9ovjF4nSrMrV/OyLvqBUJqPgjXwooeP8FoDI5LDouIrc47kqOXNTUbN8Bp80zsrTT+0FZXDnbPdiw9ZtV50Tj7bkTGkeD8zfK0WDZrfnxobGXuVC2SSTF6eGhEylz/ktALGpScB7D8ur4YZLSM7cuVeTU6ePEdMpS2vhO61Ln6r3z3MdMEip2l7v0jKaSqw4y1U6k+qWmCUJnKreEQCIDKPg/SjucdUHkhMj2e3Z+b9gzd6+VfHMSMIZ74p7LXBlmX4vEaPKVS7u7JaUYBRxwvlAAJFxi46FUfBebI9Ql5ydll96bvm65MLU7Wvjw1BDlxte4t4+yYER5Yx3xb0WuGwZOJWYUeUqjTJMJpyYjIO/nwoARMXcFHiTFXA2Lh0M3NGRW5KfRoihy4Wtc7LVl3xuKKSsMcEuLYX+x4YWTbPx7WFnMfexrDiiJPG+M2Qe1NBOCCAurvqioi2BT0tFjIh/Q7a6+VW5JoIKXe7tsGHrG/vDC5KPvqDyXgtcWoHAJe6ORvIWrYUBe7xybcm+2JfiwG2S0SoAIC5jGwYE3rkR8ZKzAqpcjg1d+s2sTbUw7kaCezskx1ZZW8lcE1Tea4GrNtZKjLZWyTq0FobJtRIa0XIE4sl0QtoJAcSDUfB5KmYRcgFVLnFnulTk9jutS7kP03CP8dutS71scmbL5Pl499i9Bee1wDW9eIx3NPzLVMcbtBaGpyyDMhymEwKIDYuO82TqZ+XpkuSsoCrXtiXXYvh269+8V/dc0HJj38/J02ERNxGobmFbstsvGlONKpetTrRoLQzL8JNrN0sxKGMmkS3aCQFEY1rd0suC3BRVTfxh8GjVfpdKMeznmdmwYWj4buuDjXlXvFzroP17uy5oyeQGgini5jrVLTx3ardfzDL51phqLDuctRY+aH72RV9QqMnOLS3PnVX7YtFj2THgl9oLs6LPfeRrPHgy+EthNz3domMt5uK0wkzLBYQiJtnZu+43spxGo++hoaId+3Z07Nd5f7onLOsf9WugYQPbP6fLiz9057/t+1SfPHu4OFuMlOoWXrZr4LIlrsH0E7UaNBt/aS/2L3IWpziutVMTY5/0tTwv9ElCOyHgX8Od+5DKqLmLtMICF4uOizF73PuSMxfybCXolg0pha8A0ElgMm0X+23ly/6KuxaV1Eam73XHeTMzuSmgv7U3B1o2oDV+nQSsF79bNPv23vrb4OtUgJldA1eSZX178SsVUteasaFrcYGKRUGSc/aCShtSFm73FlVRABFxlURl0XEhthchF1HlOi1PV3+VM66NtCFBmawlaO12+1+fFwUKrWLtyr41/R8GX3cFeMmugctVer5buTYqVbXhpFRaWXLO7X26IcjVcOXKp2UZAb9NNSvqsDEA+OL7LFEqpeWuh/y2WtpqjXsd7EvO3ACNf2ldWpiOS6ed9ITSMdeR2MWpvX7DDc5QrcY5rm1GdGm4ci1trt+l7zYn07A1mUpYHirp+e79ngBAJFx1JRN/r/nurv+TwaMFKalGq1W3VaD/Eo9Usuv1Vnt1NOjn3mnjhjvYCudytdp3589ezyz/bfCnVIAdkr1+I1N5IBVkKy2rNnTRw56D7z+5er10YUsmo+AJ5ACi4nvRcSbl7gpwVSDjvfpk6kUsQt5mA3FPGPRwEms/Dv7E5GLsas/AlWQVGQ2/C0KXfy5sjVV6Uja2upUU0PIBAL7ksOg4/XHw59JfiJpcwkgxi5C3uVHxprj9XGW2NhuzD+xqz8DV7N7vV2UB8m4IXf6UNmyJm5Vh7jDNEkBMfC86NpFUTdxAizyqXG/JVqFnmp8M/tSx7ydTeA9J7WNF2MJBkv1+szILkPdA6Jq/MoetSXUry3oCAJFwZ5PsxfWH4k/6k5yJqc0qjyBSyCLklz0ZPFoidB3Mha0f7WMlwAH2DVxVPcf1MkLX/LgBGaUNW0J1C0B8/ilnXDWlIf70ixgC4ctp2bLhUb2+P9sj4qVg09BFe+Fe3GND2MJh7Ru4kkw5/CfT0PXdylW3p4txqcc0XLm6UcYBGc9R3QIQId+LjrPIhjC44RmSQwgJZQG1ay8UBmnsZm322ACHsm/gmt3NTwXOoiZnvxl2rjQEh+ZC6nfLVx/aF49SPzG5yYRUtwDExC06Fr/VrQdu3LhE5g3Z8r7U1lW53DATCcBskMayQFx1096EX+bMFo4qOegPKG2FL2toYh4+Xrm2JDjQsHOt5UKqrbu3pczYuwUgTl7PCtkLDO/BpAjTKpf/a6OamGBuVNpqTtdWK5tS7ZvwqZFs4cfB11F+XsOvAwNXorQV7tAworeHK/97Q7Cn4SfXbmrittZ7vXuaC/ZuAYiNq56oeL0ZlrqpfhKpPMLkbBFyMEcZXLXShq4FreQwDd38Wc5cfDL4S6WHyeH4DgxcVR8Pvxf7RNj5buXqkBbDV7nHY9JCqBrFHSAjpkd1C0BsGAV/MnmNiC9yEfJuXOj6cTrB8IZUotq13UL49UcxDX9B/g4MXI69eGY06O5ci+HQVbsYqLFd1UrK30L4siyjugUgKnksOn4yeNST+OVwbaQ3JUDu4+uqXZFPMez9LGebtBBiHg4VuGgr3J+rdrmzSlU92zXsfNx+vHJlMK1qaTTBU8UwKANAdHxXt8R75ScM01Cpnqsepv526/eFLkLei6t2uUl97mxXTG2GrnJpL44Xfhg8ukFVC/NyqMA1aStUoW91f5OzXZM2wz983JYKeN4+mIwf2rtcFyQmblDG+t1VAYDIeF50HN0o+P35r/AkkgRZ5dq23WYYQfBKXdCyQXoh5vOHKMahApejRplWeDgNzcYPhyvXbsd6vsu9X39dvtpz7ZRRtQ++xKguCABEJodR8L0YR8HvZToivhqLkA+yS/BKpQReqmg1CVrw5dCBK8nO0MN6BCq65AKJqwDFUvFyrYPbQSsxfscJF4lWQgCx8r1QN6nYBDs3It6+Zni/IR3KIuTD2A5eLsC44RomyBZTHdm3q0dFC3k5ddg/2Oz2RsNPrvZV46xoeGMrQLbi1f5u5WrqLuSTLOuX6WJ+OgzkbFuN3FQzbh86oZeVayXcoJUQQHxmZ4Ea4k/Uo+D3UrMX7pnnnWauyuVGxJftTNFseErPve1vydaifZzas5bWhuTOhSzjZhJ89ZOc3eR8FvJ06MA1MdY1SUxbcByTM162OiTDlWs9SZI7zc++6EugXDUrM+NFNeZ6TIMwDkIr4fy8Ye8cCqLn7mY3WpeagrkYyRlvF4FP5Vy/LlvePlY+3/aQuZCZx9fAz1JeLtzYT46eTL/Ju61/bdmo2nIBzN7IfU9FW25AiMyNC1dJar8f2G/fimT9Ku3Q+knOfGS/1is/PXsvRbxuGTmi71au/VeVLsA9S+3dlv7Y6IPa+KmtfG0W9mI1rWT9puVClqlYyNpm7yAun1+/R+ssAAA5sxfAjWfuHPzsm/s1e5H6nvveBrK6eRHI0hf/l/m7TsKVO0fndsaOB6elNkordI4Q5XDkwPV45cqq/aQvTS9xqaj07ZPMt5pIvzbWgc/WQzf4YlwzLZNNyvsXYh1+cVhuwXFz/e4NAQAAAOboyIFr2Fmqa/LrkCpXHuzdGtWBC2FiklRNltZMbSTPnqUiW6P9KmLTitUZ+y2pZ4lMS/WaNabhyrT4+L1EbaVRn14sssIIAACAOB05cDlUuULjyuiTcnqdIHVUZmSy7CJTCQEAAODDsYbOMSI+NJOQ1SBsHZ1m2TJhCwAAAL4cK3C5EfGi1dq1gfi4Mf3nu/d7AgAAAHhy7LVKRnVVgJJSlVvn19m3BQAAAL+OHbgmbVhUuVBCKvrt+Y17HQEAAAA8O3bgcqhyoXRU0iSTRQEAAABycKLA5apcrjVLgDKYjH/XBYZkAAAAIC8nClyTv0DfXJ2OJQcCRtgCAABAAU4cuNzEQpWMKhfCRdgCAABAQU4cuCZ/yWQvF1UuBIiwBQAAgALNJXDNqlzLAoSEsAUAAICCGZmj4SdXH6pKW4CiEbYAAAAQgLlUuJ4bG6pcKJzbs0XYAgAAQAjmGria3bsDe7G7JkBBjJjNJNtqE7YAAAAQglMyZ26Ahia/XLc/bAiQI7cT7v2Nux0BAAAAAjHflkKZDtAwmd4QIEcqsnx+4x5hCwAAAEGZe+Bymt37fVdtEMA3Nxwj04Xz6/e6AgAAAATGS+Ca/MX65qr9LhXAF5X+bDhGXwAAAIAAzXUs/E7DzrWWJvqNAHPmKqi0EAIAACB03ipcznRqIQuRMUfbLYSELQAAAJSA1wrXNhYiYx7cyHfJfr7R7G6OBAAAACiBuY+F39VYb0hiHgqj4nEsZuT2u72/fpfBGAAAACiVXCpczrBzpa3T0AUcGlUtAAAAlFlugct5vPK/OkaSDQEO4s5qqd5gAiEAAADKLNfA5Txevto1Rm4KsCvXPpjdSrKtLlUtAAAAlF3ugcv5bvnqN/ZfbgnwEiOmJ1m2ZqtaqQAAAAARyGdoxg5G9SM1DNHAzHSBsQ1a9/oCAAAARKSQCpcz7FxpKJMLq+150OKcFgAAAOJUWOByhp1rLU3Ehi6tC6qDoAUAAICKKDRwOcPO1UUbur4UVMGmyfQWQQsAAABVUXjgcoadK0uamNuCCDF1EAAAANUVROBy2NEVGdoGAQAAgHACl/N45cqqEfOpoJxsyFKjX1HNAgAAAKaCClwOoatknocs6bE/CwAAAHhVcIHLIXSFzIzsJ00/y2zIkqc9KlkAAADA3oIMXA5nukJhRqI6UJUHieiAM1kAAADA4QUbuJzp9EIXutjTlY9ZuBL5VowZJFnWp00QAAAAOL6gA5czXY6sbk9XQzAPqaiMjA1Umerfp8FKRzKtXqUCAAAAYG6CD1yOrXQ1NDEPhdB1MDfEwlWo1AarxIxslSoVF7Jka8R5KwAAACBfpQhcziR0GfOlfYtbgl3ZoLV8fv1eVwAAAAAEoTSBa9vj5atdY+Sm4FW2svX+xr0FAQAAABCMRErm/Ma9joquCV5hjEkFAAAAQFBKF7ic8+v3V01mLsrkbBIAAAAAhKmUgctpdu8OTKYLxkhfAAAAACBApQ1cjhtj3vz83gIthgAAAABCVOrAtW3aYqhNocUQAAAAQECiCFyOq3aZ7M2LqnJLAAAAACAA0QQup9ntjdwUQ3e2S6h2AQAAAChYVIFrm6129d9fv9fkbBcAAACAIkUZuLY9P9ulMhAAAAAAyFnUgctxZ7ve37h30Va7bghthgAAAAByFH3g2marXb3JUA3aDAEAAADkpDKBy5kM1XjRZnhHAAAAAMCjSgWubbM2wyWCFwAAAACfKhm4thG8AAAAAPhU6cC17fXgZUYCAAAAACdE4HrJi+CVMdUQAAAAwIkZwb6GnauLUpObqtKWgBkxveb63RsCAAAAIBhUuA7Q7N7bbH5+b8G1G85GyqcCAAAAAIdAhesYhp0rbTVmyT56H9qfNiQAVLgAAACA8JwSHFmze79vv3PfggxfAAAAAMJA4DqhV8PXtVYm2k5qcjn0M18AAAAA/KOl0JNhZ7EucqaVGbOYJHLBdwCjpRAAAAAIDxUuT5rdTbfLqz/7NuHaDzMxrSQxH6pqw6aklsxJpvp3AQAAABAUKlwFcyHMfhjqWWKDmLhKmAtipiGi9aP8PSZ7drHZ/eNAAAAAAASDwBWoaUviuYatXdkwltjvpSGq9cSY34rRxvM/qGYkWXZrdpYMAAAAAAAAAAAgfv8fPRONIFLoGr8AAAAASUVORK5CYII=
servers:
  - url: https://sandboxapi.peach.finance/api
security:
  - oauth2: []
  - bearerAuth: []
  - apiKeyHeader: []
tags:
  - description: |
      Authentication and authorization related endpoints.
    name: Auth
  - description: |
      API Keys can be managed with these endpoints.
    name: API Keys
  - description: >
      Endpoints for use in configuring the frontend before and after
      authentication.
    name: Frontend
  - description: >
      The Borrower object represents a borrower.

      It allows you to maintain different statuses that are associated with the
      same borrower.

      The API allows you to create, delete and update your borrowers. You can
      retrieve

      an individual borrower as well as a list of all your borrowers.
    name: Borrowers
  - description: >
      Identity objects represent various forms of identification that a borrower
      may have.

      We allow one primary identity per borrower, and any number of secondary
      identities.

      The identity sent when creating a borrower is the primary identity, and
      cannot be

      deleted/archived or changed to be a secondary identity.
    name: Identity
  - description: >
      This object allows you to add and manage a Borrower's contact information.
      A Borrower can

      have an "unlimited" number of contacts. However, it is important to
      properly create key contact objects.


      Peach Borrower Portal (if used by the lender), shows the following
      contacts only:


      `EMAIL` contactType=email, label=personal or work, affiliation=self,
      status=primary.


      `MOBILE PHONE` contactType=phone, label=personal, affiliation=self,
      status=primary.


      `HOME PHONE` contactType=phone, label=home, affiliation=self,
      status=secondary.


      `HOME ADDRESS` contactType=address, label=home, affiliation=self,
      status=primary.



      The Peach system sends notices (e.g. payment reminder) to borrowers (if
      configured by the lender).

      In order for a notice to be sent successfully, both contact object and
      template must exist.

      If a contact cannot be found, the system will not send a notice.

      The system will try to find the following contact objects:



      Email notices:

      contactType=email, valid=true, affiliation=self, status=primary

      (if "primary" is not found, the system searches for "secondary" and then
      for "additional")



      Text message/SMS notices:

      contactType=phone, valid=true, affiliation=self, receiveTextMessages=true,
      label=personal, status=primary

      (if "primary" is not found, the system searches for "secondary" and then
      for "additional")
    name: Contact Information
  - description: >
      This object represents a payment method (e.g. bank account, credit card,
      debit card, etc.) belonging to a borrower.
    name: Payment Instruments
  - description: >
      This object allows you to block interactions on a borrower; and must be
      connected with a case. You can

      create multiple Do Not Interact instances on a borrower but only one
      instance on a case. There are two ways

      to create Do Not Interacts:


      1. Manually - after a case is created, you can manually create Do Not
      Interact objects on any borrower case.


      2. In bulk on a Supercase, on the related subcases. See [Create Do Not
      Interact instances on all
      subcases](#tag/Supercases/operation/peach.supercases.handlers.supercase_bulk_create_dni)

      for more details.
    name: Do Not Interact
  - description: >
      This object allows you to create custom `Do Not Interact Types` which will
      create

      `Do Not Interact` instances automatically when case conditions are met.
      For example,

      when a new `bankruptcy` case is `initiated`, the system can automatically
      create `Do Not Interact`

      to block debt collection related interactions for 30 calendar days.


      The conditions are set in the following way. There are two triggers and
      one condition fields that you can configure:

      1. `onStatus` - triggered based on the case status.

      2. `onOutcome` - triggered based on the case outcome.

      3. `onCondition` - condition(s) based on case fields values.


      You must provide at least one trigger, `onStatus` or `onOutcome`, when
      creating a new `Do Not Interact Type` object.


      Few examples:

      - `onStatus=processing`, `onOutcome=null`, `onCondition=null` - the `Do
      Not Interact`

      instance will be created when the case status is changed to `processing`.

      - `onStatus=completed`, `onOutcome=approved`, `onCondition=null` - the `Do
      Not Interact`

      instance will be created when the case status is changed to `completed`
      and the outcome is `approved`.


      `Do Not Interact Types` must be associated with `Case Types`. A `Do Not
      Interact Type` object can

      be associated with multiple `Case Types`.
    name: Do Not Interact Types
  - description: >
      This object allows you to create custom `Notification Types` which will
      create

      `interaction` instances (such as emails, text messages, etc.)
      automatically when case conditions are met. For example,

      when a new `bankruptcy` case is `initiated`, the system can automatically
      send an email notification

      and ask the borrower to provide supporting documents.


      The conditions are set in the following way. There are two triggers and
      one condition fields that you can configure:

      1. `onStatus` - triggered based on the case status.

      2. `onOutcome` - triggered based on the case outcome.

      3. `onCondition` - condition(s) based on case fields values.


      You must provide at least one trigger, `onStatus` or `onOutcome`, when
      creating a new `Notification Type` object.


      Few examples:

      - `onStatus=processing`, `onOutcome=null`, `onCondition=null` - the
      `interaction`

      instance will be created when the case status is changed to `processing`.

      - `onStatus=completed`, `onOutcome=approved`, `onCondition=null` - the
      `interaction`

      instance will be created when the case status is changed to `completed`
      and the outcome is `approved`.


      `Notification Types` must be associated with `Case Types`. A `Notification
      Type` object can

      be associated with multiple `Case Types`.
    name: Notification Types
  - description: >
      The campaign feature allows lenders to create a list of borrower contacts
      that meet certain criteria,

      for consumption by auto-dialer systems. For example, if the "Auto-create
      collection cases" procedure is

      configured along with the auto-close feature you can create a query that
      looks at the open collection

      cases to understand what borrowers you consider to still be delinquent
      after starting collections on

      them. You can then layer on which cases have been snoozed and/or do not
      have scheduled calls.

      The campaign feature has two basic components. The Campaign, is a query
      that collects a list of borrowers

      to contact that can be triggered at predefined intervals. The Contact
      Exporter defines how and where the

      contacts are delivered. Multiple Campaigns can use a single Exporter. The
      lender can create and maintain

      a list of Campaigns and Contact Exporters as needed.
    name: Campaign Overview
  - description: >
      This object allows you to create custom Campaigns. A Campaign is
      characterized by a set of rules, defined

      as a SQL query created in Redash and associated with the Campaign. A
      Campaign can be triggered at predefined

      intervals. For example, a Campaign can be triggered every day to add
      borrowers who are 30 days past due. Campaigns

      can also be manually triggered.

      When a Campaign is triggered by schedule or manually, a query is executed
      against the lender's replica data and

      returns a list of person IDs. The output is sent to the configured Contact
      Exporter to be written as a configurable

      CSV file with contact information required by auto dialers and other
      systems.
    name: Campaigns
  - description: >
      This object allows you to create custom Contact Exporters. The Contact
      Exporter defines how and where the

      contacts generated by the Campaign are delivered.
    name: Contact Exporters
  - description: >
      This object allows you to add cases to a borrower that are relevant to
      servicing

      or collections. For example, a bankruptcy case. A borrower can have
      multiple

      cases. If you enabled Compliance Guard monitoring feature, we'll create a
      new case

      every time a borrower matches to one of the external data sources we use.
      For example,

      if you monitor for active military, and we match one of your borrowers to

      the SCRA (https://scra.dmdc.osd.mil/scra/) database we'll create a new
      case

      with type=`militaryDuty`.
    name: Cases
  - description: >
      This object allows you to create custom case types. You then can create
      case instances from a case type.

      Peach has a predefined collection of special case types,

      such as `bankruptcy`, `identityTheft`, and more. You can use any of the
      special types

      as your base case type. To customize your case type you can:

      - Add additional custom fields

      - Add and remove automatic `Do Not Interact Types`

      - Add custom name

      - Add custom description


      If you don't want to use any of the special predefined case types, then
      use `generic` as your base type.
    name: Case Types
  - description: |
      The Smart Reviews system allows for creating reminder tasks in the Peach
      CRM based on certain key events or triggers. For example, a trigger could
      be when a borrower starts military service.

      At creation time, all case types are supplied with a default smart review
      configuration that is disabled by default. Smart review tasks can be
      enabled by setting the `smartReviews.enable` flag.

      ## Key Dates

      For most case types, configuration revolves around 'key dates' and you
      specify when you want a reminder task to be created relative to these key
      dates:

      ```
      GET /case-type/{caseTypeId}

      // returns something like...

      {
              "caseType": "militaryDuty",
              // <other fields ...>
              "smartReviews": {
                      "enable": true,
                      "config": {
                              "keyDates": {
                                      "dutyStartDate": 0,
                                      "dutyEndDate": 0,
                              }
                      }
              }
      }
      ```

      Key dates offsets can be expressed as an integer or array of
      integers. Whenever `(keyDateFieldValue + offset) == today`, then a review
      task will be created. That is:

      - For an offset of 0, create a task on the key date
      - For an offset of -1, create a task the day before the key date
      - For an offset of 1, create a task the day after the key date

      and so on. This math is based on calendar days and not business days.

      The following is a list of base case types that use key dates and their
      supported key date fields:

      - `bankruptcy`
        - `courtCaseClosedDate`
        - `creditorClaimDeadlineDate`
        - `anticipatedCaseCompletionDate`

      - `creditBureauDispute`
        - `responseDueDate`

      - `debtValidation`
        - `requestDate`

      - `deceased`
        - `deceasedNoticeReceivedDate`

      - `disputeOfDebt`
        - `noticeReceivedDate`

      - `identityTheft`
        - `reportReceivedDate`

      - `legalAction`
        - `legalActionIntiatedDate`
        - `legalJudgementEffectiveDate`

      - `militaryDuty`
        - `dutyStartDate`
        - `dutyEndDate`

      ## Collections

      `collection` type cases operate on a different set of rules:

      The field `objectsPreventingReminderTasks` is an array of any combination
      of the following string values:

      - `dni`
      - `scheduledCall`
      - `snooze`

      If present in `objectsPreventingReminderTasks`, the associated object will
      cause a task to not be created if it exists; `["dni"]` will prevent a new
      task when the borrower has a DNI, and so on.

      The field `lastOutboundInteractionThreshold` is a positive integer
      indicating how many calendar days after the last outbound interaction to
      wait until creating a reminder task. If this field is 3, and the last
      interaction was sent 3/20, then a reminder will be created on 3/23
      (assuming nothing otherwise prevents a task from being created).
    name: Smart Reviews
  - description: >
      This object allows for the management of many cases across a number of
      borrowers. That is

      to say that a supercase can create, manage, and close many cases at once.


      This is particularly useful if an issue occurs which affects a large group
      of borrowers.


      - Cases created by a supercase are called `subcases`

      - A supercase can only manage cases it has created (i.e., NOT cases
      created via the `/cases` endpoint)


      Managing "who" is affected by a supercase is an important aspect of
      supercases:


      - A `member` of a supercase is one "borrower-loan" pairing.

      - A `population` is a set of members added at once.
        - A supercase might have many populations if different members are
          added at different times.
        - It's useful to keep track of sets of members like this because different
          actions might need to be taken on different members depending on when
          they're added to a supercase.
        - A `population`'s membership may be changed until it is "committed" by setting
          `isDraft: false`, at which time the memberships are locked and subcases are created.
    name: Supercases
  - description: >
      This object allows you to add or create documents related to a borrower.
      There are multiple ways to use document object:
        - Render a document from a Peach template. For example, loan terms or Autopay agreement.
        - Upload any type of file. For example, a PDF copy of borrower's driver license.
        - Documents can also be used to render a legal disclosure from Peach template.

      To create a new document there are two steps:
        1. Create a document descriptor.
        2. Upload document content/file.

      When a new document is rendered from the template you just need to
      complete step #1.
    name: Documents
  - description: |
      Explicit consent to receive certain kinds of communications.
    name: Consent
  - description: >
      If a borrower is represented by a legal entity you can add the legal
      entity details.

      Normally, if a borrower is represented by a status=`active` legal entity
      we block

      future debt collection related communications.
    name: Legal Representation
  - description: >
      Interactions represent communications with a borrower.


      Whenever Peach communicates with a borrower an interaction is recorded.


      Additionally, communications taking place outside of Peach  should be
      recorded

      as interactions.


      Past interactions information is used by Compliance Guard to make
      decisions

      about when and how it is appropriate to communicate again with a borrower.
    name: Interactions
  - description: >
      Compliance Guard helps ensures communications with borrowers are compliant
      with

      regulations.
    name: Compliance Guard
  - description: >
      Borrowers typically have loans. We support multiple loan types and each
      loan type

      comes with its set of federal and state compliance rules. You can maintain
      different statuses of a loan.

      A borrower can have multiple loans. A loan can belong to multiple people,
      but

      only one borrower can be defined as a `mainBorrower`. A loan is always
      created using

      the `mainBorrower` borrower identifier. Other people can be added as part
      of the loan

      details.


      All loan attributes can be updated as long as the loan is in `pending`
      status. Once the

      loan status changes to `originated` attributes of `atOrigination` object
      become read only and

      cannot be updated.


      A Loan doesn't start accruing interest until it is activated. To activate
      the loan, call `Activate a loan`.

      On activation the loan can use the due dates and payments schedule from
      the `atOrigination` object

      or the loan can be re-amortized using the activation date as the loan
      start date.
    name: Loans
  - description: >
      Rate caps are rate limits applied to loans and draws to ensure compliance
      with various regulations.


      They prevent calculated interest rates (spread + index) from exceeding
      specified maximums. Rate caps can be applied

      to loans and line of credit draws. When multiple rate caps overlap on the
      same

      dates, the system automatically uses the lowest value to ensure
      compliance.
    name: Rate Caps
  - description: >
      This object represents an installment advance (also called loan proceeds
      or loan disbursements). Advances should be used for installment

      loans of type "multiple advances". Advances can be made on Loan objects
      only. To clarify, Advances cannot be made on Line of Credit

      objects. Advances increase principal balance of a Loan. Each advance has a
      unique identifier.
    name: Installment Advances
  - description: >
      This object represents refunds. Various situations require full or partial
      refunds of a loan. Depending on the refund

      amount and whether the borrower has made payments, a refund may also
      trigger a reimbursement to the borrower.
    name: Installment Refunds
  - description: >
      This object represents a draw. Draws can be made on Line of Credit loans
      only. Draws can be amortized

      or non-amortized. If amortized, the draw will be amortized over the
      selected number of periods and aligned to the Line of

      Credit due dates. If non-amortized, the draw is due on a due date
      following the current period statement creation.

      A draw can have different interest and promo rates from the Line of
      Credit. Each draw has a unique identifier, similar to a loan.
    name: Line of Credit Draws
  - description: >
      This object represents a line of credit purchase. Purchases can be made on
      Draw objects only. Purchases of type regular increase

      principal balance of a Draw. Some purchase types, such as `cashBack` or
      `refund` are actually reduce the principal balance of a Draw.

      Each purchase has a unique identifier.
    name: Line of Credit Purchases
  - description: >
      This object represents the rules, configurations, and other settings
      surrounding a loan type

      or financial product. A lender can configure multiple loan types. Each
      type represent a financial product.

      Once the loan type is created, you can create instances of that type.
    name: Loan Types
  - description: >
      This object represents the expected loan payments on due dates. Expected
      payments are what we expect to

      receive from a borrower on a specific date. Expected payments are created
      as a result of loan amortization.

      The amounts and due dates can change during lifetime of a loan. For
      example, a borrower might change due dates

      frequency from `monthly` to `weekly` and it will lower periodic payment
      amount.
    name: Expected Payments
  - description: >
      This object represents information on the borrower's obligation for a
      given loan period. It also provides information

      on the current status of the fulfillment of the obligation vis-à-vis the
      amount due and the due date. The obligation

      is dynamically changing as a result of factors such as payments and
      service credits made, and the crossing over of due dates.
    name: Obligations
  - description: >
      Payment plans are a specific type of hardship tool that can be used to
      create a temporary loan schedule for a borrower.

      Lenders can create a payment plan by specifying the `paymentPlanType`,
      `numberOfPeriods` and `amount`. After the `numberOfPeriods`

      ends, any remaining periods of the loan will be paid according to the
      originally scheduled recurring amount and frequency of the

      loan at the time when the payment plan was created.


      When the agreed upon recurring payment plan `amount` is less than the
      originally scheduled payment amount, the system uses

      `isExtendLoanDuration` to ascertain whether to keep the existing loan
      `duration` or automatically extend the original loan `duration`.


      When the agreed upon recurring payment plan `amount` is more than the
      originally scheduled recurring amount, the loan `duration`

      will be shortened to the point where the remaining balance of the loan is
      paid off.


      Only one active payment plan is allowed at a time. Please note that
      creating an active payment plan will overwrite changes

      made to the loan schedule such as due date deferrals, change due date, and
      change loan terms. This is because the payment plan by

      design creates a new loan schedule.


      If a loan is on a payment plan, other hardship tools cannot be used.
      Lenders must cancel the payment plan and then make any required

      loan modifications.


      Payment plan is presently for installment only.
    name: Payment Plans
  - description: >
      This object represents a `Promise to Pay Plan`. A `Promise to Pay Plan` is
      a group of Promise to Pay

      Periods— unscheduled payments that was verbally committed by a borrower.
      `Promise to Pay Plan`s are

      defined on an account level. `Promise to Pay Plan`s are not guaranteed
      payments. They are used to track

      verbal commitments made by borrowers.


      Note: When creating or updating a `Promise to Pay Plan`, either pass a
      `schedule` object, or pass schedule descriptor

      attributes— `startDate`, `frequency`, `specificDays`, `duration` and
      `amount`. Mixing the two

      approaches is not allowed.
    name: Promise to Pay Plans
  - description: >
      This object contains information about the fees that are charged to the
      loan, including draw, origination or

      dynamic fees, such as late fees.
    name: Fees
  - description: >
      This object represents the interest and promo rates of the loan. You can
      modify interest and promo rates at any time.

      If a rate is modified or added with an effective date in the past, we will
      recalculate loan balances retroactively and

      future expected payments from the effective date. If a rate is modified or
      added with effective date in the future, we

      will recalculate future expected payments only.
    name: Rates
  - description: >
      This object represents payments and credits. Payments represent real money
      that were paid back by borrowers. Credits

      are adjustments made on a loan. Credits lower balances similar to
      payments. Credits can be issued by customer service

      representatives or supervisors.
    name: Transactions
  - description: >
      This object represents line of credit (e.g. credit card) or loan (e.g.
      personal installment) statement. Each statement is

      associated with one due date.


      For lines of credit, statements are created one calendar day after the
      period end date. The number of dates between a

      statement creation and a due date can be configured by lenders, but are
      normally 14 or 21 days.


      For installments, there are two options for when statements can be
      created:

      1. One calendar day after the period end date, which is also the due date.
      In this case, the statement date and due date are the same.

      2. A number of calendar days before the period end date. The offset (as
      number of calendar days) can be configured by lenders.
         In this case, a statement is created and sent before the period ends, which means some of the statement details are calculated
         based on partial period data (e.g. amount of interest accrued in the period.)
    name: Statements
  - description: >
      This object represents the current Autopay plan. The current Autopay plan
      must be canceled before creating a new plan. The autopay

      cadence can be aligned to due dates or can be on a different payment
      schedule.
    name: Autopay
  - description: |
      This object represents current loan balances.
    name: Balances
  - description: >
      This object represents loan credit reporting data as it was reported to
      credit bureaus.
    name: Credit Reporting
  - description: >
      This utility function returns financial institution name that a routing
      number belongs to.

      This information is updated once or twice a month by the Federal Reserve
      Bank.
    name: Routing Numbers
  - description: |
      This utility function returns card details.
      The BIN information is provided by First Data and normally updated weekly.
    name: BIN Numbers
  - description: >
      This utility function is used for managing index interest rates (for
      example, a rate that is pegged to the prime rate

      of the Fed). Index Interest Rates are set at the loan type level and can
      be used by loans associated with the loanTypeId.

      Index Interest Rates are only relevant to interest rates and not relevant
      to promo rates.


      Index Interest Rate values can be updated with a new value with an
      effective date in the past. When a new Index Interest

      Rate value is set, the previous rate end date will be set to one calendar
      day before the new rate's effective date.

      If the new rate's effective date is in the past, the Peach system will
      replay all Active loans (to clarify, Active loans

      at the time of Index Interest Rate update) with the new Index Interest
      Rate value and re-accrue loans' interest.
    name: Index Rates
  - description: |
      Operations represent ongoing asynchronous tasks in the Peach system. When
      you start an asynchronous task, either directly by having an API call with
      `sync=false` or indirectly by having an API call with `sync=true` time
      out, you will receive an operation ID that can be used to monitor its
      status.

      When an operation completes, the operation ID will continue to be valid
      for 1 hour, after which it will expire and become inaccessible.

      Under certain exceptional circumstances, an asychronous task may be
      delayed and not complete before 24 hours have passed. At that point, the
      operation ID will expire despite still being in-flight. If this happens,
      please reach out to Peach support.
    name: Operations
  - description: >
      This object represents an event. Events are sent from Peach to you. Events
      can be

      related to any object in this API.


      | Event Name                                  | Occurs
      when                                                           | Related
      Object     |

      |---------------------------------------------|-----------------------------------------------------------------------|--------------------|

      | advance.statuschanged                       | an advance status
      changes                                             | Advance            |

      | advance.updated                             | an advance amount is
      updated                                          | Advance            |

      | autopay.schedule.created                    | an autopay schedule is set
      up                                         | Autopay            |

      | autopay.schedule.cancel                     | an autopay schedule is
      canceled                                       | Autopay            |

      | autopay.schedule.changed                    | an autopay schedule is
      changed                                        | Autopay            |

      | autopay.payment.rescheduled                 | an autopay payment is
      rescheduled                                     | Autopay            |

      | autopay.payment.canceled                    | an autopay payment is
      canceled                                        | Autopay            |

      | card.created                                | a card is
      created                                                     |
      Card               |

      | card.replacement.requested                  | a card replacement is
      requested                                       | Card               |

      | card.status.changed                         | a card's status is
      changed                                            | Card               |

      | case.changed                                | a case is created,
      updated, or deleted, with precise change information | Case             |

      | case.created                                | [**DEPRECATED** - no
      longer fired, use case.changed instead] a case is created         |
      Case               |

      | case.deleted                                | [**DEPRECATED** - was
      never used, use case.changed instead] a case is deleted         |
      Case               |

      | case.updated                                | [**DEPRECATED** - no
      longer fired, use case.changed instead] a case is updated         |
      Case               |

      | case.association.added                      | an association is added to
      a case                                     | Case               |

      | case.association.removed                    | an association is removed
      from a case                                 | Case               |

      | case.donotinteract.changed                  | a DoNotInteract object is
      created, updated, or deleted, with precise change information |
      Case               |

      | case.donotinteract.created                  | [**DEPRECATED** - use
      case.donotinteract.changed instead] a DoNotInteract object is created |
      Case               |

      | case.donotinteract.deleted                  | [**DEPRECATED** - use
      case.donotinteract.changed instead] a DoNotInteract object is deleted |
      Case               |

      | case.donotinteract.updated                  | [**DEPRECATED** - use
      case.donotinteract.changed instead] a DoNotInteract object is updated |
      Case               |

      | case.donotinteract.expired                  | a DoNotInteract object has
      expired                                    | Case |

      | case.escalation.changed                     | a case escalation is
      created, updated, or deleted, with precise change information | Case  |

      | case.escalation.created                     | [**DEPRECATED** - use
      case.escalation.changed instead] a case escalation is created |
      Case               |

      | case.escalation.canceled                    | [**DEPRECATED** - use
      case.escalation.changed instead] a case escalation is canceled |
      Case               |

      | contact.created                             | a contact is
      created                                                  |
      Contact            |

      | contact.deleted                             | a contact is
      deleted                                                  |
      Contact            |

      | contact.updated                             | a contact is
      updated                                                  |
      Contact            |

      | communication.send                          | communication is
      attempted                                            | Interaction       
      |

      | indexrate.created                           | index rate is
      created                                                 | Loan
      Type          |

      | indexrate.updated                           | index rate is
      updated                                                 | Loan
      Type          |

      | interaction.blocked                         | interaction is blocked for
      a borrower                                 | Interaction        |

      | loan.balance.changed                        | a loan balance
      changed                                                |
      Loan               |

      | loan.closed                                 | a loan is
      closed                                                      |
      Loan               |

      | loan.created                                | a loan is
      created                                                     |
      Loan               |

      | loan.credit.limit.changed                   | a loan credit limit was
      changed                                       | Loan               |

      | draw.credit.limit.changed                   | a draw credit limit was
      changed                                       | Draw               |

      | loan.creditreporting.created                | a loan is scheduled to
      start credit reporting                         | Credit Reporting Status |

      | loan.creditreporting.stopped                | a loan is scheduled to
      stop credit reporting                          | Credit Reporting Status |

      | loan.current                                | a loan is current or
      became current                                   | Loan               |

      | loan.duedate.defer                          | a single loan due date is
      deferred                                    | Loan               |

      | loan.fee.booked                             | a dynamic fee is
      applied                                              | Loan              
      |

      | loan.fee.canceled                           | a dynamic fee is
      canceled                                             | Loan              
      |

      | loan.fee.changed                            | a dynamic fee is
      changed                                              | Loan              
      |

      | loan.interest.capitalized                   | interest capitalization is
      triggered after a due date                 | Loan               |

      | loan.interestaccrued.min                    | minimum interest charge is
      triggered on a draw                        | Draw               |

      | loan.latefee.booked                         | a late fee is
      applied                                                 |
      Loan               |

      | loan.modificationfee.booked                 | a modification fee is
      applied                                         | Loan               |

      | loan.migration.succeeded                    | a loan migration
      succeeds                                             | Loan              
      |

      | loan.migration.failed                       | a loan migration
      fails                                                | Loan              
      |

      | loan.obligation.statuschanged               | a change in a loan's
      obligation status is recorded                    | Loan               |

      | loan.overdue                                | a loan is
      overdue                                                     |
      Loan               |

      | loan.overdue.update                         | a loan is
      overdue                                                     |
      Loan               |

      | loan.ownerchanged                           | a loan changes
      owners                                                 |
      Loan               |

      | loan.paymentplan.setup                      | a loan payment plan is set
      up                                         | Loan               |

      | loan.period.started                         | a loan period has
      started                                             | Loan               |

      | loan.promiseplan.created                    | a promise to pay plan is
      created                                      | Promise to Pay Plan|

      | loan.promiseplan.statuschanged              | a promise to pay plan
      status changes                                  | Promise to Pay Plan|

      | loan.promiseplan.due.today                  | a promise to pay plan is
      due today                                    | Promise to Pay Plan|

      | loan.promiseplan.overdue                    | a promise to pay plan
      becomes "overdue"                               | Promise to Pay Plan|

      | loan.promiseplan.current                    | a promise to pay plan
      changes from "overdue" to "current"             | Promise to Pay Plan|

      | loan.promoprogram.created                   | a promo program is
      created                                            | Loan               |

      | loan.promoprogram.updated                   | a promo program is
      updated                                            | Loan               |

      | loan.rate.created                           | rate is
      created                                                       |
      Loan               |

      | loan.rate.updated                           | rate is
      updated                                                       |
      Loan               |

      | loan.refunded                               | payments on a loan are
      refunded                                       | Loan               |

      | loan.reimbursement.initiated                | a borrower reimbursement
      is initiated                                 | Loan               |

      | loan.reimbursement.processed                | a borrower reimbursement
      is processed                                 | Loan               |

      | loan.schedule.defer                         | a loan schedule is
      deferred                                           | Loan               |

      | loan.changeloanterms.scra.update            | a loan SCRA plan is
      created                                           | Loan               |

      | loan.scraplan.changed                       | a loan SCRA plan is
      changed                                           | Loan               |

      | loan.scraplan.deleted                       | a loan SCRA plan is
      deleted                                           | Loan               |

      | loan.servicefee.booked                      | a service fee is
      booked                                               | Loan              
      |

      | loan.membershipfee.booked                   | a membership fee is
      booked                                            | Loan               |

      | loan.statuschanged                          | a loan changes
      status                                                 |
      Loan               |

      | person.consent.updated                      | a borrower updates their
      consents                                     | Borrower           |

      | person.created                              | a borrower is
      created                                                 |
      Borrower           |

      | person.monitoring.bankruptcy.started        | bankruptcy and deceased
      monitoring begins for a borrower              | Borrower           |

      | person.monitoring.scra.started              | SCRA monitoring begins for
      a borrower                                 | Borrower           |

      | payment.instrument.created                  | a payment instrument is
      created                                       | Payment Instrument |

      | payment.instrument.updated                  | a payment instrument is
      updated                                       | Payment Instrument |

      | payment.instrument.deactivated              | a payment instrument is
      deactivated                                   | Payment Instrument |

      | payment.applied                             | **DEPRECATED** used in
      place of payment.initiated for internal ACH prior to deprecation. |
      Transaction        |

      | payment.chargeback                          | a payment is charged
      back                                             | Transaction        |

      | payment.chargeback.reversed                 | a payment is chargeback is
      reversed                                   | Transaction        |

      | payment.failed                              | a payment
      fails                                                       |
      Transaction        |

      | payment.initiated                           | a payment is
      initiated                                                |
      Transaction        |

      | payment.pending                             | a payment is
      pending                                                  |
      Transaction        |

      | payment.reversed                            | a payment is
      reversed                                                 |
      Transaction        |

      | payment.succeeded                           | a payment is
      succeeded                                                |
      Transaction        |

      | payment.scheduled                           | a payment is
      scheduled                                                |
      Transaction        |

      | payment.rescheduled                         | a payment is
      rescheduled                                              |
      Transaction        |

      | payment.due.today                           | periodically for external
      transactions with a status of "scheduled"   | Transaction        |

      | payment.hold.days.expired                   | a transaction's hold days
      expired                                     | Transaction        |

      | paymentplan.created                         | a payment plan is
      created                                             | Payment Plan       |

      | paymentplan.statuschanged                   | a payment plan changes
      status                                         | Payment Plan       |

      | purchase.authorized                         | a purchase is
      authorized                                              |
      Purchase           |

      | purchase.settled                            | a purchase is
      settled                                                 |
      Purchase           |

      | purchase.applied                            | a purchase is
      applied.                                                |
      Purchase           |

      | purchase.created                            | a purchase is
      created                                                 |
      Purchase           |

      | purchase.changed                            | a purchase is
      updated                                                 |
      Purchase           |

      | purchase.dispute.created                    | a purchase dispute is
      created                                         | Purchase Dispute   |

      | purchase.dispute.updated                    | a purchase dispute is
      updated                                         | Purchase Dispute   |

      | statement.created                           | a statement is
      created                                                |
      Loan               |

      | reconciliation.payment.failed               | a reconciliation payment
      fails                                        | Transaction        |
    name: Events
  - description: |
      Notification settings designed to increase loan repayment.
    name: Repayment Engine
  - description: >
      This object represents institutional owners of loans. Investors must be
      created before they

      can be associated with loans.
    name: Investors
  - description: >
      A settlement instrument is a bank account belonging to a loan investor.
      The Peach payment

      processor uses these accounts to wire settlement proceeds to investors
      after collecting

      borrower payments.


      Settlement instruments are only relevant for companies using the
      Peach-managed payment

      processor (`isSettlementRequired: true`). Companies using a third-party
      payment processor

      handle investor settlement outside of Peach and do not use these
      endpoints.
    name: Settlement Instruments
  - description: >
      This object represents a bank account belonging to a payment processor.
      Peach uses the funding

      instrument's available balance (sourced from BAI files) to wire investor
      settlement payments.
    name: Funding Instruments
  - description: |
      Investors associated with a loan.
    name: LoansInvestors
    x-displayName: Loan Investors
  - description: |
      Loan Configuration
    name: LoanConfiguration
    x-displayName: Loan Configuration
  - description: >
      A borrower verification session represents the

      question and response flow for an agent to verify the identity of a human

      who purports to be a particular borrower. For instance, upon receiving a
      phone

      call, an agent would initiate a borrower verification, ask the questions
      to the

      borrower, and enter their responses. A set of responses are either correct
      (thus

      verifying the human as the borrower) or they are incorrect.


      The agent is never shown the correct answers, so privacy risks are

      minimized and socially engineered security attacks are mitigated.
    name: Verifications
  - description: >
      This object represents configurations describing how new borrower
      verifications

      should behave.
    name: Verification Types
  - description: >
      Allows configuration for which fields should be included for loans or
      payments tapes.
    name: Loan Tape Types
  - description: >
      Allows investors to get different loan tapes delivered to different SFTP
      servers.
    name: Loan Tapes
  - description: >
      Allows lenders to keep track of merchants associated with loans and
      purchases.

      Merchant details can be shown in the Peach Borrower Portal. The following
      attributes are shown to a borrower:


      `NAME` businessName


      `ADDRESS` address


      `DEPARTMENT OR CONTACT NAME` primaryContactName


      `EMAIL` primaryContactEmail


      `PHONE` primaryContactPhone
    name: Merchants
  - description: >
      Allows lenders to keep track of different collection agencies that
      charged-off loans may be assigned to.

      This is useful when a lender assigns charged off loans to a third party
      debt collection agency.

      The Peach Borrower Portal will display the collection agency information
      to the borrower. The lender can continue to use Peach as the system

      of record / ledger for charged off loans. The lender can post any payments
      collected by the collection agency as `isExternal=true` transactions.

      The Peach system will waterfall the payments and update loan balances.
    name: Collection Agencies
  - description: |
      Allows a loan to be assigned to a collection agency
    name: Loan Collection Agencies
  - description: >
      The templates system is used manage templates and render content from
      existing templates. Templates can be used, for

      instance, when sending emails and text messages. Custom branding and
      dynamic fields can be added into

      templates.


      ## Management

      The templates system consists of two main components: Template Descriptors
      and Template Versions (also sometimes

      simply referred to as "templates"). A Template Descriptor is a
      configuration object that defines the structure

      of a template. A Template Version is a specific instance of a template
      that contains the actual content.


      A Template Descriptor many have many Template Versions associated with it.
      There can be only one "active"

      Template Version at a time.


      ## Content

      ### Syntax

      Peach uses <a href="https://jinja.palletsprojects.com/">Jinja
      templating</a>. Therefore all templates

      use Jinja template syntax, and _must be a valid Jinja template to render_.


      ### Rendering Context

      When a template is rendered, context variables are passed into the
      template. If a template looks like:


      ```

      Hello {{foo}}, your loan is due on {{bar}}.

      ````


      then the context variables in the template are `foo` and `bar`. If, when
      the template is

      rendered, the provided context is:


      ```

      {
        "foo": "John",
        "bar": "2021-01-01"
      }

      ```


      ...then the rendered template will be:


      ```

      Hello John, your loan is due on 2021-01-01.

      ```
    name: Templates
  - description: >
      Peach automatically sends messages on your behalf. For example when
      autopay is enabled for a borrower

      a message with subject `autopayEnabled` is sent.


      ### Automatically Calculated Context Vars

      When the Peach system sends messages it automatically calculates context
      variables.

      These context variables can be referenced in the template content. For
      example, when the system

      sends `autopayEnabled` it includes the populated context variables
      `paymentMethod`, `paymentMethodLastFour`,

      and `paymentSchedule`.


      ### Customization

      Peach comes with predefined template content out-of-the-box. You can
      customize the content of these messages

      by updating the content of the template associated with the subject. See

      <a
      href="/api-docs/api-public/templates/peach.communicator.handlers.update_template_version">Update
      Template Version</a>.


      If you choose to customize the content of a template it's important to
      understand that different

      interaction subjects have different automatically calculated context
      variables.


      For example, you can see below the subject `autopayAmountChanged` with
      context variables

      `company`, `person`, `loan`, `extraCharge`, `paymentAmount` and
      `paymentDueDate`. This means

      for the template with `subject=autopayAmountChanged` you can write a
      template like:


      <!--
        We must include this jinja raw escape because Connexion runs the openapi spec through
        a Jinja template render when loading the spec at boot up time.
        We must put it in an HTML comment so Redoc doesn't show the raw escape in the docs. (I hate computers.)
        {% raw %}
      -->

      ```jinja

      Hello {{person.name.firstName}},


      This is {{company.brandName}} from {{company.domainName}}, in regards to
      your loan

      {{loan.displayId}}.


      Your autopay changed. It is now {{paymentAmount}}. (That's an additional
      {{extraCharge}}.)


      Bye!

      ```

      <!-- {% endraw %} -->


      ### Available Context Variables

      In this section of the docs you can see what context variables are
      automatically calculated for a

      given subject's system sent messages. (Note the list is currently
      incomplete.)
    name: System Sent Messages
  - description: >
      Peach displays some messages as documents or UI elements. You may choose
      to customize the content of these messages

      using the templating system.


      ### Available Context Variables

      In this section of the docs you can see what context variables are
      automatically calculated for a

      given subject's system displayed message. (Note the list is currently
      incomplete.)
    name: System Documents & UI
  - name: Monitoring Services
  - description: >
      Peach allows clients to bring their own/partner bank to process ACH
      payments.

      If configured, the Peach system will create NACHA files and upload them to
      the provided destination (SFTP).

      The Peach system will download NACHA return files from the same
      destination. Make sure you coordinate this setup with the Peach team.


      NACHA requires bank accounts to be verified. If you are using Peach system
      to process ACH payments, borrowers have two options to verify their bank
      account:

      1. Connect their online bank account via Plaid.

      2. Trigger micro-deposits and verify amounts.


      Please note the following logic of how Peach system selects payment
      processor for micro-deposits. A payment method is associated with a
      borrower

      object instead of a specific loan because the same method can be used to
      pay multiple loans.

      - If you have only one loan type and one payment processor with
      `default=true`, the system will use the `default=true` payment processor
      to initiate micro-deposits.

      - If you have more than one loan type and one payment processor with
      `default=true`, the system will use the `default=true` payment processor
      to initiate micro-deposits.

      - If you have have more than one loan type and more than one payment
      processor:
          - You can associate a specific payment processor with a loan type.
          - If a borrower has one or more loans in status [`pending`, `originated`, `active`, `frozen`, `accelerated`, `chargedOff`] of ONE loan type only,
            the system will use that loan type's ACH payment processor for micro-deposits. If the loan type doesn't have an ACH payment processor
            associated, the system will use the `default=true` processor to initiate micro-deposits.
          - If a borrower has one or more loans in status [`pending`, `originated`, `active`, `frozen`, `accelerated`, `chargedOff`] of more than one
            loan type, the system will use the `default=true` processor to initiate micro-deposits.
    name: Payment Processors
  - description: |
      **BETA**

      Allows clients to manage configurations for card issuers.
    name: Card Issuers
  - description: >
      **BETA**


      Allows lenders to associate physical or virtual card with a loan or line
      of credit.
    name: Cards
  - description: >
      Allows clients to manage webhooks.


      The Peach webhook system will issue `POST` requests with the event data as
      JSON payload.
    name: Webhooks
  - description: >
      Send and receive communications like email and text messages with
      borrowers and their contacts. When

      sending and receiving communications an interaction is usually created.
    name: Communicator
  - description: >
      A bulk sender object represents a campaign worker which sends messages

      to the borrowers returned by a campaign's query results.


      For each row returned by the campaign in its query result a message is
      sent via the

      <a
      href="/api-docs/api-public/communicator/peach.communicator.handlers.handle_send">Send
      endpoint</a>.


      Some of the query results columns are automatically mapped to the request
      body of the Send endpoint,

      these columns are:

      - `caseId`

      - `contactId`

      - `context`

      - `interactionExternalId`

      - `isTransactional`

      - `loanId`

      - `previousInteractionId`

      - `statementId`

      - `sendAt`

      - `useTemplate`


      In order for a bulk sender to function, at a minimum the

      campaign's query results must return at least the column

      `borrowerId`.


      Note that bulk senders send with `{ strictUndefined: true }` so any
      missing context variables 

      will cause the send request to fail rather than sending with a default
      (empty) value, which is

      the standard behavior for the `/communicator/send` endpoint.


      For more details on required columns see

      per-`InteractionSubject` documentation for&nbsp;

      <a
      href="/api-docs/api-public/campaigns/peach.people.campaigns.handlers_runs.campaign_run_create">Campaign
      run</a>.
    name: Bulk Senders
  - description: >
      Tasks are used to track work that needs to be done by agents in the CRM.
      Tasks

      are automatically assigned to agents based on configurable characteristics
      of

      the agents and the tasks.
    name: Tasks
  - description: >
      Task-Worker Pairing Configs are used to configure the behavior of tasks in
      the CRM. A TWPC

      is used to define the rules for how tasks are assigned to agents (i.e.,
      workers).


      In order to configure a TWPC you need to understand the contents of task
      and worker

      objects. See the

      <a
      href="/api-docs/api-public/tasks/peach.twilio.taskrouter.handlers.list_unterminated_tasks">List
      Unterminated Task</a>

      endpoint and the

      <a
      href="/api-docs/api-public/tasks/peach.twilio.taskrouter.handlers_workers.list_workers">List
      Workers</a>

      endpoint for more details.
    name: Task-Worker Pairing Configs
  - name: Line of Credit Migration
  - description: Errors
    name: Errors
paths:
  /3rdparty/{companyId}/plaid/credentials:
    post:
      description: >
        Store or replace the Plaid API credentials associated with this company.


        These credentials are used by Peach to connect to Plaid on the company's
        behalf for

        operations such as bank account linking and balance checks. Both fields
        are required;

        partial updates are not supported — submitting new credentials replaces
        the existing ones entirely.
      operationId: peach.company.handlers.third_party_update_plaid_credentials
      parameters:
        - $ref: '#/components/parameters/companyId'
      requestBody:
        $ref: '#/components/requestBodies/Plaid'
      responses:
        '204':
          description: OK
      security:
        - oauth2:
            - company:update.sensitive
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update a company's Plaid credentials
      tags:
        - Companies
  /active-escalations:
    get:
      description: |
        List active case escalations for a company
      operationId: peach.cases.escalations.handlers.case_open_escalations_get_by_company
      parameters:
        - $ref: '#/components/parameters/sortBy'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          $ref: '#/components/responses/CaseEscalationDetailedPaging'
      security:
        - oauth2:
            - case:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: List active case escalations for a company
      tags:
        - Cases
  /amortize:
    post:
      description: >
        This utility generates an amortization schedule for an installment loan
        or line of credit draw.

        The `atOrigination` field is where you specify various loan or
        draw-specific inputs such as the

        start date, amount to be financed, and duration.


        You can specify generic loan type configurations as part of the request
        body (or omit these

        fields and use the default configurations). Alternatively, you can use
        predefined loan type

        configurations by passing in a `loanTypeId`. For a line of credit draw,
        you can also pass in

        a `loanId` in place of a `loanTypeId`. When a `loanId` is provided, the
        amortization calculation

        will reference the configurations of the loan type associated with the
        `loanId`, and will also

        use the line of credit start date and rates associated with the `loanId`
        if these fields are

        not passed in.


        When generating an amortization schedule from a predefined loan type,
        you can pass in either a

        `personAddress` or `personAddressId` to check the amortization output
        against any existing rate

        caps associated with the loan type.


        Note for the "Predefined Line Of Credit" option only:

        - If the loan type is configured to accrue interest as
        `accrualMethod=compoundWithFees`, there is

        a known limitation to the draw amortization calculation logic.

        - The draw amortization calculation will be done using the `compound`
        method and not `compoundWithFees`.

        To ensure that the system calculates interest accurately, amortized
        draws should NOT include any fees.
      operationId: peach.loans.handlers.amortization_get
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AmortizableLoan'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/Amortize'
      security:
        - oauth2:
            - loan:amortize
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Amortize loan
      tags:
        - Loan Amortization
  /amortize-combinations:
    post:
      description: >
        NOTE: This endpoint does not support recurring dynamic fees. Origination
        fees and other dynamic non-recurring fees are supported.
      operationId: peach.loans.handlers.amortization_combinations
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AmortizeCombinationsBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/AmortizationCombinationsResult'
                    type: object
          description: Success
      security:
        - oauth2:
            - loan:amortize
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Amortize loan combinations
      tags:
        - Loan Amortization
  /auth/exchange-token:
    post:
      operationId: peach.security.handlers.exchange_token_create
      parameters: []
      requestBody:
        $ref: '#/components/requestBodies/ExchangeTokenPost'
      responses:
        '200':
          $ref: '#/components/responses/TemporaryTokenResponse'
      security:
        - oauth2:
            - auth:exchange-token
        - bearerAuth: []
        - apiKeyHeader: []
      summary: >-
        Takes a user ID and returns a temporary token that can be exchanged for
        a real auth token.
      tags:
        - Auth
  /auth/password:
    post:
      operationId: peach.security.handlers.password_post
      requestBody:
        $ref: '#/components/requestBodies/AuthPost'
      responses:
        '200':
          $ref: '#/components/responses/SingletonResponse'
      security:
        - oauth2: []
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Change password
      tags:
        - Auth
  /auth/permissions:
    get:
      operationId: peach.security.handlers.permissions_get
      responses:
        '200':
          $ref: '#/components/responses/UserPermissions'
      security:
        - oauth2: []
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get all permissions for the requesting user
      tags:
        - Auth
  /auth/token:
    delete:
      operationId: peach.security.handlers.logout
      responses:
        '200':
          $ref: '#/components/responses/SingletonResponse'
      security:
        - oauth2: []
        - bearerAuth: []
      summary: End login session, invalidating current login token.
      tags:
        - Auth
    post:
      operationId: peach.security.handlers.validate_and_send_token
      parameters:
        - $ref: '#/components/parameters/companyIdQuery'
        - $ref: '#/components/parameters/domainQuery'
        - $ref: '#/components/parameters/userTypeQuery'
        - $ref: '#/components/parameters/authTypeQuery'
        - $ref: '#/components/parameters/authValueTypeQuery'
      requestBody:
        $ref: '#/components/requestBodies/AuthPost'
      responses:
        '200':
          $ref: '#/components/responses/JWT'
      security: []
      summary: Exchange username and password for JWT token
      tags:
        - Auth
    put:
      operationId: peach.security.handlers.renew_jwt_token
      responses:
        '200':
          $ref: '#/components/responses/JWT'
      security:
        - oauth2: []
        - bearerAuth: []
      summary: Exchange current token for a new one
      tags:
        - Auth
  /auth/token/short-lived:
    post:
      operationId: peach.security.handlers.short_lived_token
      requestBody:
        content:
          application/json:
            schema:
              properties:
                permissions:
                  description: >
                    List of permissions that the short-lived token can have.
                    These can only be permissions that are already given to the
                    calling user.
                  items:
                    type: string
                  type: array
              type: object
        required: true
      responses:
        '200':
          $ref: '#/components/responses/JWT'
      security:
        - oauth2:
            - auth.short-lived-token:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create a short-lived token
      tags:
        - Auth
  /auth/user:
    get:
      operationId: peach.security.handlers.user_info_get
      parameters: []
      responses:
        '200':
          $ref: '#/components/responses/UserInfo'
      security:
        - oauth2: []
        - bearerAuth: []
        - apiKeyHeader: []
      summary: |
        Get logged-in user's info.
      tags:
        - Auth
  /bin-numbers:
    post:
      operationId: peach.bin_numbers.handlers.get_bin_number
      requestBody:
        content:
          application/json:
            schema:
              properties:
                cardNumber:
                  description: >-
                    The card number. Must provide at least first 4 digits of the
                    card number.
                  example: '4111111111111111'
                  pattern: ^\d{4,}$
                  type: string
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        properties:
                          cardNetwork:
                            description: The card network.
                            enum:
                              - visa
                              - mastercard
                              - discover
                              - americanexpress
                            example: visa
                            nullable: true
                            type: string
                          cardType:
                            description: The card type.
                            enum:
                              - credit
                              - debit
                            example: debit
                            type: string
                          issuer:
                            description: The card issuer institution name.
                            example: First United Bank
                            type: string
                          lastUpdatedDate:
                            description: >
                              Peach system receives a BIN list published by
                              First Data/Fiserv a few times per month.

                              This is the date when Peach received the latest
                              update.
                            type: string
                        type: object
                    type: object
          description: Card Details
        '404':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        properties:
                          lastUpdatedDate:
                            description: >
                              Peach system receives a BIN list published by
                              First Data/Fiserv a few times per month.

                              This is the date when Peach received the latest
                              update.
                            type: string
                        type: object
                    type: object
          description: Not found
      security:
        - oauth2:
            - bin.numbers:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get BIN details from card number
      tags:
        - BIN Numbers
  /bootstrap:
    get:
      description: >
        Get pre-auth app metadata and settings.


        Fetch metadata and settings for a Peach application. This endpoint is
        public readable

        because this information is necessary to properly render the frontend
        even for

        users who are not yet logged-in — i.e., the login page needs to have the
        right

        company name and color scheme.


        Since multiple frontend application are supported by the backend you
        must specify

        for *which* frontend application this bootstrap request is intended. The
        best way

        to do this is by specifying domain. e.g., `domain=myappdomain.com`.
        (Please note

        that a "Company App Domain" must already be configured for your
        environment for

        this to work. There is no public API for this yet, so contact support.)


        You may also specify the `companyId` and `appDomainType` instead of the
        `domain`,

        but this is discouraged and mostly intended for development / debugging.
      operationId: peach.security.handlers.bootstrap
      parameters:
        - $ref: '#/components/parameters/companyIdQuery'
        - $ref: '#/components/parameters/domainQuery'
        - $ref: '#/components/parameters/appDomainTypeQuery'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FrontendPreauthBootstrap'
          description: Success
      security: []
      summary: Get bootstrap data
      tags:
        - Frontend
  /campaign-workers/bulk-senders:
    get:
      description: |
        Get a list of all bulk senders.
      operationId: peach.people.campaigns.handlers_workers.bulk_sender_list
      parameters:
        - $ref: '#/components/parameters/sortBy'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
      responses:
        '200':
          $ref: '#/components/responses/BulkSenderList'
      security:
        - oauth2:
            - bulksender:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: List bulk senders
      tags:
        - Bulk Senders
    post:
      description: |
        Create a new bulk sender.
      operationId: peach.people.campaigns.handlers_workers.bulk_sender_create
      requestBody:
        $ref: '#/components/requestBodies/BulkSenderCreate'
      responses:
        '201':
          $ref: '#/components/responses/BulkSender'
      security:
        - oauth2:
            - bulksender:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create bulk sender
      tags:
        - Bulk Senders
  /campaign-workers/bulk-senders/{bulkSenderId}:
    delete:
      description: |
        Delete a bulk sender by ID.
      operationId: peach.people.campaigns.handlers_workers.bulk_sender_delete
      parameters:
        - $ref: '#/components/parameters/bulkSenderId'
      responses:
        '200':
          description: Success
      security:
        - oauth2:
            - bulksender:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete bulk sender
      tags:
        - Bulk Senders
    get:
      description: |
        Get a bulk sender by ID.
      operationId: peach.people.campaigns.handlers_workers.bulk_sender_get
      parameters:
        - $ref: '#/components/parameters/bulkSenderId'
      responses:
        '200':
          $ref: '#/components/responses/BulkSender'
      security:
        - oauth2:
            - bulksender:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get bulk sender by ID
      tags:
        - Bulk Senders
    put:
      description: |
        Update the existing bulk sender
      operationId: peach.people.campaigns.handlers_workers.bulk_sender_update
      parameters:
        - $ref: '#/components/parameters/bulkSenderId'
      requestBody:
        $ref: '#/components/requestBodies/BulkSenderUpdate'
      responses:
        '200':
          $ref: '#/components/responses/BulkSender'
      security:
        - oauth2:
            - bulksender:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update bulk sender
      tags:
        - Bulk Senders
  /campaign-workers/contact-exporters:
    get:
      description: |
        Get a list of all contact exporters.
      operationId: peach.people.contact_exporters.handlers.contact_exporter_list
      parameters:
        - $ref: '#/components/parameters/sortBy'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
      responses:
        '200':
          $ref: '#/components/responses/ContactExporterList'
      security:
        - oauth2:
            - contactexporter:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: List contact exporters
      tags:
        - Contact Exporters
    post:
      description: >
        Create a new Contact Exporter by defining the contact matching criteria
        and the exportable columns. If

        desired, designate an SFTP setting and/or screen through Compliance
        Guard.


        When contacts are screened, the exporter calls Compliance Guard with the
        `checkAtCompanyNoon` flag enabled.

        See the `checkAtCompanyNoon` field on the <a
        href="/api-docs/api-public/compliance-guard/peach.people.handlers.can_interact">Can
        Interact Endpoint</a> for

        further information. In other words, regardless of the time of day that
        the exporter runs, compliance is

        checked as of noon in the company's time zone. This does not override
        other reasons a check can fail:

        the borrower having a Do Not Interact in place, having reached the
        interaction frequency limit, etc.


        Where possible, it's always advised to check compliance right before an
        action. Many things can change

        (payments are made, other automated interactions are sent,
        consents/addresses can be updated)

        from when you plan something to happen to when it actually happens.
        Lenders are responsible for ensuring

        it is still permissible to conduct the interaction.
      operationId: peach.people.contact_exporters.handlers.contact_exporter_create
      requestBody:
        $ref: '#/components/requestBodies/ContactExporterCreate'
      responses:
        '200':
          $ref: '#/components/responses/ContactExporter'
      security:
        - oauth2:
            - contactexporter:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create contact exporter
      tags:
        - Contact Exporters
  /campaign-workers/contact-exporters/{contactExporterId}:
    delete:
      description: |
        Delete a contact exporter by ID.
      operationId: peach.people.contact_exporters.handlers.contact_exporter_delete
      parameters:
        - $ref: '#/components/parameters/contactExporterId'
      responses:
        '200':
          description: Success
      security:
        - oauth2:
            - contactexporter:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete contact exporter
      tags:
        - Contact Exporters
    get:
      description: |
        Get a contact exporter by ID.
      operationId: peach.people.contact_exporters.handlers.contact_exporter_get_by_id
      parameters:
        - $ref: '#/components/parameters/contactExporterId'
      responses:
        '200':
          $ref: '#/components/responses/ContactExporter'
      security:
        - oauth2:
            - contactexporter:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get contact exporter by ID
      tags:
        - Contact Exporters
    put:
      description: |
        Update a contact exporter by ID.
      operationId: peach.people.contact_exporters.handlers.contact_exporter_update
      parameters:
        - $ref: '#/components/parameters/contactExporterId'
      requestBody:
        $ref: '#/components/requestBodies/ContactExporterUpdate'
      responses:
        '200':
          $ref: '#/components/responses/ContactExporter'
      security:
        - oauth2:
            - contactexporter:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update contact exporter
      tags:
        - Contact Exporters
  /campaigns:
    get:
      description: |
        Get a list of all campaigns.
      operationId: peach.people.campaigns.handlers.campaign_get_all
      parameters:
        - $ref: '#/components/parameters/sortBy'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
      responses:
        '200':
          $ref: '#/components/responses/BorrowerCampaignList'
      security:
        - oauth2:
            - borrowercampaign:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get campaigns
      tags:
        - Campaigns
    post:
      description: >
        Create a new campaign by associating a Redash query that returns a
        single column containing

        borrower IDs labeled "id". The campaign can also be scheduled.
      operationId: peach.people.campaigns.handlers.campaign_create
      requestBody:
        $ref: '#/components/requestBodies/BorrowerCampaignCreate'
      responses:
        '200':
          $ref: '#/components/responses/BorrowerCampaign'
      security:
        - oauth2:
            - borrowercampaign:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create campaign
      tags:
        - Campaigns
  /campaigns/{borrowerCampaignId}:
    get:
      description: |
        Get a campaign by ID.
      operationId: peach.people.campaigns.handlers.campaign_get
      parameters:
        - $ref: '#/components/parameters/borrowerCampaignId'
      responses:
        '200':
          $ref: '#/components/responses/BorrowerCampaign'
      security:
        - oauth2:
            - borrowercampaign:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get campaign by ID
      tags:
        - Campaigns
    put:
      description: |
        Update a campaign by ID.
      operationId: peach.people.campaigns.handlers.campaign_update
      parameters:
        - $ref: '#/components/parameters/borrowerCampaignId'
      requestBody:
        $ref: '#/components/requestBodies/BorrowerCampaignUpdate'
      responses:
        '200':
          $ref: '#/components/responses/BorrowerCampaign'
      security:
        - oauth2:
            - borrowercampaign:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update campaign
      tags:
        - Campaigns
  /campaigns/{borrowerCampaignId}/runs:
    get:
      description: |
        Get a list of campaign runs.
      operationId: peach.people.campaigns.handlers_runs.campaign_run_list
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/borrowerCampaignId'
      responses:
        '200':
          $ref: '#/components/responses/BorrowerCampaignList'
      security:
        - oauth2:
            - borrowercampaign.run:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get campaign runs
      tags:
        - Campaigns
    post:
      description: >
        Start a new borrower campaign run and save results.


        The behavior of the campaign run is controlled by configured settings on

        the campaign object and via the associated `BulkSender` and
        `ContextExporter` objects.


        By default when the campaign runs, it executes the Redash query
        referenced in the

        `redashQueryUrl` and feeds the query results as input to the campaign
        run.


        Optionally, you can override this by specifing a `queryResultsOverride`
        field

        as input.
      operationId: peach.people.campaigns.handlers_runs.campaign_run_create
      parameters:
        - $ref: '#/components/parameters/borrowerCampaignId'
      requestBody:
        $ref: '#/components/requestBodies/BorrowerCampaignRunCreate'
      responses:
        '200':
          $ref: '#/components/responses/BorrowerCampaignRun'
      security:
        - oauth2:
            - borrowercampaign.run:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Run campaign
      tags:
        - Campaigns
  /campaigns/{borrowerCampaignId}/runs/{borrowerCampaignRunId}:
    get:
      description: |
        Get campaign run data by ID.
      operationId: peach.people.campaigns.handlers_runs.campaign_run_read
      parameters:
        - $ref: '#/components/parameters/borrowerCampaignId'
        - $ref: '#/components/parameters/borrowerCampaignRunId'
      responses:
        '200':
          $ref: '#/components/responses/BorrowerCampaignRun'
      security:
        - oauth2:
            - borrowercampaign.run:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get campaign run
      tags:
        - Campaigns
    put:
      description: |
        Update campaign run data.
      operationId: peach.people.campaigns.handlers_runs.campaign_run_update
      parameters:
        - $ref: '#/components/parameters/borrowerCampaignId'
        - $ref: '#/components/parameters/borrowerCampaignRunId'
      requestBody:
        $ref: '#/components/requestBodies/BorrowerCampaignRunUpdate'
      responses:
        '200':
          $ref: '#/components/responses/BorrowerCampaignRun'
      security:
        - oauth2:
            - borrowercampaign.run:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update campaign run
      tags:
        - Campaigns
  /campaigns/{borrowerCampaignId}/runs/{borrowerCampaignRunId}/download:
    get:
      description: |
        Download files generated by a campaign run.
      operationId: peach.people.campaigns.handlers_runs.campaign_run_download
      parameters:
        - $ref: '#/components/parameters/borrowerCampaignId'
        - $ref: '#/components/parameters/borrowerCampaignRunId'
        - $ref: '#/components/parameters/downloadFile'
      responses:
        '200':
          description: Success
      security:
        - oauth2:
            - borrowercampaign.run:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Download all files
      tags:
        - Campaigns
  /card-issuers:
    get:
      operationId: peach.card_issuers.handlers.card_issuers_list
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
      responses:
        '200':
          $ref: '#/components/responses/CardIssuerPagingResponse'
      security:
        - oauth2:
            - card.issuer:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get card issuers
      tags:
        - Card Issuers
    post:
      description: Creates a new card issuer.
      operationId: peach.card_issuers.handlers.card_issuer_create
      parameters: []
      requestBody:
        $ref: '#/components/requestBodies/CardIssuerPost'
      responses:
        '200':
          $ref: '#/components/responses/CardIssuerResponse'
      security:
        - oauth2:
            - card.issuer:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create card issuer
      tags:
        - Card Issuers
  /card-issuers/{cardIssuerId}:
    delete:
      operationId: peach.card_issuers.handlers.card_issuer_delete
      parameters:
        - $ref: '#/components/parameters/cardIssuerId'
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - card.issuer:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete card issuer
      tags:
        - Card Issuers
    get:
      operationId: peach.card_issuers.handlers.card_issuer_get
      parameters:
        - $ref: '#/components/parameters/cardIssuerId'
      responses:
        '200':
          $ref: '#/components/responses/CardIssuerResponse'
      security:
        - oauth2:
            - card.issuer:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get card issuer by ID
      tags:
        - Card Issuers
    put:
      operationId: peach.card_issuers.handlers.card_issuer_update
      parameters:
        - $ref: '#/components/parameters/cardIssuerId'
      requestBody:
        $ref: '#/components/requestBodies/CardIssuerPut'
      responses:
        '200':
          $ref: '#/components/responses/CardIssuerResponse'
      security:
        - oauth2:
            - card.issuer:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update card issuer
      tags:
        - Card Issuers
  /case-types:
    get:
      operationId: peach.cases.case_types.handlers.list_case_type
      parameters:
        - $ref: '#/components/parameters/loanTypeIdFilter'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/smartReviewsEnable'
      responses:
        '200':
          $ref: '#/components/responses/CaseTypesPaging'
      security:
        - oauth2:
            - case.type:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get case types
      tags:
        - Case Types
    post:
      operationId: peach.cases.case_types.handlers.create_case_type
      requestBody:
        $ref: '#/components/requestBodies/CaseTypePost'
      responses:
        '200':
          $ref: '#/components/responses/CaseType'
      security:
        - oauth2:
            - case.type:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create type
      tags:
        - Case Types
  /case-types/{caseTypeId}:
    get:
      operationId: peach.cases.case_types.handlers.get_case_type_by_id
      parameters:
        - $ref: '#/components/parameters/caseTypeId'
        - $ref: '#/components/parameters/version'
      responses:
        '200':
          $ref: '#/components/responses/CaseType'
      security:
        - oauth2:
            - case.type:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get type by ID
      tags:
        - Case Types
    put:
      description: >
        A `PUT` request is used to update an existing type configuration. While
        the type is in `draft` status requests

        can move it to `active`. Setting the `status` to `deprecated` will
        immediately hide it from future `GET`

        all requests, and spawn a `draft` replica which can be edited and
        published in its place.
      operationId: peach.cases.case_types.handlers.update_case_type
      parameters:
        - $ref: '#/components/parameters/caseTypeId'
        - $ref: '#/components/parameters/version'
      requestBody:
        $ref: '#/components/requestBodies/CaseTypePut'
      responses:
        '200':
          $ref: '#/components/responses/CaseType'
      security:
        - oauth2:
            - case.type:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update type
      tags:
        - Case Types
  /case-types/{caseTypeId}/associations:
    delete:
      operationId: peach.cases.case_types.handlers.case_type_remove_association
      parameters:
        - $ref: '#/components/parameters/caseTypeId'
        - in: query
          name: objectType
          required: true
          schema:
            enum:
              - doNotInteractType
              - notificationType
              - loanType
            type: string
        - description: The ID of the object to dissociate from
          in: query
          name: objectId
          required: true
          schema:
            format: int32
            type: integer
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - case.type.association:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Remove association
      tags:
        - Case Types
    post:
      operationId: peach.cases.case_types.handlers.case_type_add_association
      parameters:
        - $ref: '#/components/parameters/caseTypeId'
        - in: query
          name: objectType
          required: true
          schema:
            enum:
              - doNotInteractType
              - notificationType
              - loanType
            type: string
        - description: The ID of the object to associate with
          in: query
          name: objectId
          required: true
          schema:
            format: int32
            type: integer
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - case.type.association:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Add association
      tags:
        - Case Types
  /case-types/{caseTypeId}/create-smart-review-tasks:
    post:
      operationId: peach.cases.case_types.handlers.create_smart_review_tasks
      parameters:
        - $ref: '#/components/parameters/caseTypeId'
        - $ref: '#/components/parameters/caseTypeSmartReviewsAsOfDate'
      responses:
        '200':
          description: Run successful with no reminder tasks created
        '201':
          $ref: '#/components/responses/SmartReviewsTasksCreated'
      security:
        - oauth2:
            - case:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create case type review tasks for ID
      tags:
        - Case Types
  /cases:
    get:
      description: |
        Get all cases. Returns only borrower-bound cases by default.
      operationId: peach.cases.handlers.list_cases_by_company
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/sortBy'
        - $ref: '#/components/parameters/expand'
        - $ref: '#/components/parameters/includeFields'
        - $ref: '#/components/parameters/associations'
        - $ref: '#/components/parameters/caseOutcome'
        - $ref: '#/components/parameters/caseStatus'
        - $ref: '#/components/parameters/caseStatuses'
        - $ref: '#/components/parameters/caseStatusUpdatedBefore'
        - $ref: '#/components/parameters/caseStatusUpdatedAfter'
        - $ref: '#/components/parameters/caseNumber'
        - $ref: '#/components/parameters/caseType'
        - $ref: '#/components/parameters/caseTypeId'
        - $ref: '#/components/parameters/createdBefore'
        - $ref: '#/components/parameters/createdAfter'
        - $ref: '#/components/parameters/nupUpdatedNull'
        - $ref: '#/components/parameters/snoozedUntilBefore'
        - $ref: '#/components/parameters/snoozedUntilAfter'
        - $ref: '#/components/parameters/owningEmployeeId'
        - $ref: '#/components/parameters/loanTypes'
        - $ref: '#/components/parameters/filterInteractionStatus'
        - $ref: '#/components/parameters/filterInteractionChannel'
        - $ref: '#/components/parameters/filterInteractionScheduledAtFromBefore'
        - $ref: '#/components/parameters/filterInteractionScheduledAtFromAfter'
        - $ref: '#/components/parameters/filterInteractionScheduledAtToBefore'
        - $ref: '#/components/parameters/filterInteractionScheduledAtToAfter'
        - $ref: '#/components/parameters/associatedDocumentId'
      responses:
        '200':
          $ref: '#/components/responses/CasesPaging'
      security:
        - oauth2:
            - case:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get all cases
      tags:
        - Cases
  /communicator/preview:
    post:
      description: >
        Render the template and return as a JSON response.


        It selects an appropriate Template Descriptor (matching `subject`,
        `channel`), and

        renders the active Template Version with the given `context`. 


        The three contents are returned in a single JSON response, they are
        `contentHtml`,

        `contentText` and `subjectLine`.


        NOTE: This is different from the `/render` endpoints because it does not

        return a *file* but rather the simple text-respresentation of the
        rendered

        templates that would be used in rendering a file. It is generally easier

        to test and debug the rendered templates as JSON strings rather than,
        for

        instance a PDF file.
      operationId: peach.communicator.handlers.preview
      requestBody:
        content:
          application/json:
            schema:
              properties:
                caseId:
                  type: string
                channel:
                  $ref: '#/components/schemas/InteractionChannel'
                context:
                  type: object
                loanId:
                  type: string
                overrideTemplateId:
                  $ref: '#/components/schemas/OverrideTemplateId'
                personId:
                  type: string
                subject:
                  $ref: '#/components/schemas/InteractionSubject'
              required:
                - subject
                - channel
                - personId
              type: object
        description: Template selectors and the data.
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  contentHtml:
                    type: string
                  contentText:
                    type: string
                  subjectLine:
                    type: string
                type: object
          description: OK
      security:
        - oauth2:
            - communicator:render
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Render template preview for subject
      tags:
        - Communicator
  /communicator/preview-free-form-email:
    post:
      description: >
        Render a template for "free-form" emails and return is as JSON.


        A free-form message is one that can contain any content.


        Templates previewed via this endpoint will be free-form but still be
        branded.

        i.e., they will use the `freeFormBranded` interaction subject, not
        `freeForm`.


        This returns the three contents of a template in a single JSON
        response, 

        they are `contentHtml`, `contentText` and `subjectLine`.
      operationId: peach.communicator.handlers.preview_free_form_email
      requestBody:
        content:
          application/json:
            schema:
              properties:
                contentHtml:
                  description: The content of the email in the HTML format.
                  type: string
                contentPlain:
                  description: The content of the email in the plain text format.
                  type: string
                subjectLine:
                  description: The subject line of the email.
                  type: string
              type: object
        description: Subject line and content of the free form email.
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  contentHtml:
                    type: string
                  contentText:
                    type: string
                  subjectLine:
                    type: string
                type: object
          description: OK
      security:
        - oauth2:
            - communicator:render
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Preview free-form email
      tags:
        - Communicator
  /communicator/receive:
    post:
      description: >
        Receive a message.


        This is different from a normal `/interactions` creation because

        it creates the interaction and also performs associated "inbound
        message"

        actions:


        - if the message is an email sent to an email address configured as
          "unmonitored", it will autorespond that the email was not received because
          it was sent to an "unmonitored address".
        - it will publish a taskrouter task for inbound interactions (either
          `handleInboundInteraction` or `handleUnboundInboundInteraction`).
      operationId: peach.communicator.handlers.handle_receive
      requestBody:
        $ref: '#/components/requestBodies/CommunicatorReceiveOnlyPost'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/Interaction'
                    type: object
          description: Success
      security:
        - oauth2:
            - interaction:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Receive message
      tags:
        - Communicator
  /communicator/render:
    post:
      description: >
        Render a file (`text`, `html` or `pdf`) from template and download it.


        It selects an appropriate Template Descriptor (matching `subject`,
        `channel`), and

        renders the active Template Version with the given `context`. Only

        the content matching the `fmt` query parameter is returned in the file.


        The rendered template file is then downloaded as an attachment. (i.e., a

        response is sent with the header `Content-Disposition: attachment`.)


        Note: that a Document Descriptor is NOT created.
      operationId: peach.communicator.handlers.render
      parameters:
        - $ref: '#/components/parameters/renderFormat'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/TemplateRender'
                - required:
                    - subject
                    - channel
                    - personId
                  type: object
        description: Template selectors and the data
        required: true
      responses:
        '200':
          content:
            text/plain:
              schema:
                type: string
          description: OK
      security:
        - oauth2:
            - communicator:render
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Render to download
      tags:
        - Communicator
  /communicator/render-to-document:
    post:
      description: >
        Render a file (`text`, `html` or `pdf`) from template and write it to a
        document descriptor.


        It selects an appropriate Template Descriptor (matching `subject`,
        `channel`), and

        renders the active Template Version with the given `context`. Only

        the content matching the `fmt` query parameter is returned in the file.


        The rendered template file is then associated with the given
        `documentId`. (i.e., this

        new content can be downloaded via that Document Descriptor.)


        WARNING: if there is existing document content for that document it will
        be

        overwritten.
      operationId: peach.communicator.handlers.render_to_document
      parameters:
        - $ref: '#/components/parameters/renderFormat'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/TemplateRender'
                - properties:
                    documentId:
                      description: >
                        The unique identifier of the Document Descriptor. Can be
                        Peach or lender's external identifier. The rendered
                        content will create a file in HTML or text format and
                        associate it with the documentId. To convert the
                        rendered document to PDF please use another endpoint,
                        `convert_person_document`, as an extra step.
                      type: string
                    statementId:
                      description: >
                        The unique identifier of the Statement. Can be Peach or
                        lender's external identifier. The statement attributes
                        will be used as dynamic fields in the template.
                      type: string
                  required:
                    - subject
                    - channel
                    - personId
                    - documentId
                  type: object
        description: Template selectors, context and the document ID.
        required: true
      responses:
        '200':
          content:
            text/plain:
              schema:
                type: string
          description: OK
      security:
        - oauth2:
            - communicator:render
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Render to document
      tags:
        - Communicator
  /communicator/resend:
    post:
      description: |
        Copy the fields from an existing interaction into a new interaction
        and queue that new interaction for sending. 

        WARNING: This message is not checked against Compliance Guard.
      operationId: peach.communicator.handlers.resend
      requestBody:
        content:
          application/json:
            schema:
              properties:
                interactionId:
                  description: The interaction to resend.
                  type: string
              required:
                - interactionId
              type: object
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        properties:
                          interactionId:
                            description: ID of the new interaction.
                            type: string
                        type: object
                    type: object
          description: Accepted
        '404':
          description: Not Found
      security:
        - oauth2:
            - communicator:send
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Resend existing interaction
      tags:
        - Communicator
  /communicator/send:
    post:
      description: >
        Send a message and save it as a new interaction.


        The message is checked against Compliance Guard and may be rejected

        if it violates any rules. 


        If the message is accepted, it is queued for send. 

        You can check the status of the queued interaction by calling 

        `GET` on `/interactions/{interactionId}` endpoint with the interaction
        ID

        returned by this endpoint.


        ## Context Variables

        ### Hydratable Context Variables

        Certain context variables can be "hydrated" by this endpoint for use in
        the template

        being rendered for sending. 


        For instance, if you provide a `loanId` in the request

        body it is "hydrated" to a `loan` object and passed to the context. This
        means you

        can then reference things like `{{loan.displayId}}` when customizing the
        template.


        - `companyId` hydrates to `company`

        - `loanId` hydrates to `loan`

        - `loanIds` hydrates to `loans`

        - `caseId` hydrates to `case`


        ### No Automatic Context Variables

        Note that this endpoint does not automatically fill in context
        variables.


        If the template you're sending requires context variables, you must
        provide them. This

        can sometimes be confusing because Peach will automatically calculate
        and include 

        context variables when the system sends a message automatically. See

        <a href="/api-docs/api-public/system-sent-messages">System Sent
        Messages</a> for more information.


        ## Difference from `/interactions` endpoint

        Note this is different from `POST`ing to a `/interactions` endpoint
        because those

        endpoints create the interaction object, but do NOT send an actual
        message. 

        (You can think of that endpoint as creating a historical log of an
        interaction

        which happened elsewhere.)
      operationId: peach.communicator.handlers.handle_send
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommunicatorSend'
        required: true
      responses:
        '202':
          description: OK
        '409':
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                type: object
          description: >
            The request was well-formed but was unable to be processed due to
            failed business logic validations. This includes scenarios where:

            - The template for this type of message is disabled.

            - No suitable email or phone contact found.

            - The contact does not belong to the specified borrower.

            - The borrower is inactive or not eligible for the type of
            interaction attempted.

            - Communication consent for the requested channel has been revoked
            by the borrower.

            - The contact information is marked as invalid or archived.

            - The borrower has opted out of receiving certain types of messages
            (e.g., text messages) to the specified contact method.

            - The interaction is blocked by Compliance Guard due to federal,
            state, or business rules violations.

            - The request fails due to time-of-day restrictions outside
            permitted communication hours, though this case will specifically
            include a `sendAt` attribute indicating the next allowable time.

            - The loan associated with the communication is missing critical
            details or does not belong to the borrower.

            - An invalid address prevents determining applicable state rules for
            communication.

            Each failure is accompanied by a detailed message explaining the
            specific reason the interaction cannot proceed.
      security:
        - oauth2:
            - communicator:send
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Send message
      tags:
        - Communicator
  /communicator/send-confirmation-code:
    post:
      description: |
        Send a verification code to an email or phone number.

        This creates a confirmation code in the system which can be used
        via the `.../contacts` endpoint to verify the contact. (i.e., this 
        sets the `verified` attribute of the contact to `true`.)

        This endpoint is rate limited to 10 requests per *borrower*
        per hour.

        An interaction is created with InteractionSubject `confirmationCode`.

        NOTE: This endpoint is not checked against Compliance Guard, however
        it should never be necessary to restrict sending confirmation codes
        due to compliance guard rules.
      operationId: peach.communicator.confirmation_codes.handlers.send_confirmation_code
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                channel:
                  $ref: '#/components/schemas/InteractionChannel'
                context:
                  description: >
                    Template specific properties to substitute in the
                    corresponding

                    ConfirmationCode template.
                  type: object
                email:
                  description: The destination email address.
                  type: string
                personId:
                  description: |
                    The borrower's unique identifier. Can be Peach or lender's
                    external identifier.
                  type: string
                phone:
                  description: The destination phone number.
                  type: string
              required:
                - personId
              type: object
        required: true
      responses:
        '202':
          description: OK
      security:
        - oauth2:
            - communicator.confirmationcode:send
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Send confirmation code for contact verification
      tags:
        - Communicator
  /communicator/send-free-form-email:
    post:
      description: >
        Sends an email with the `freeFormBranded` template. 


        This selects the Template Descriptor with `subject=freeFormBranded` and

        its currently active Template Version. The `freeFormBranded`` template
        allows 

        for the insertion of completely custom content within a standard branded
        email

        template.


        WARNING: This endpoint is not checked against Compliance Guard.
      operationId: peach.communicator.handlers.send_free_form_email
      requestBody:
        content:
          application/json:
            schema:
              properties:
                contentHtml:
                  description: The content of the email in the HTML format.
                  type: string
                contentPlain:
                  description: The content of the email in the plain text format.
                  type: string
                isTransactional:
                  $ref: '#/components/schemas/SendIsTransactionalDefaultFalse'
                language:
                  $ref: '#/components/schemas/language'
                personalizations:
                  description: >
                    Specifies the email destination. See the body of POST
                    /mail/send at https://sendgrid.com/docs/api-reference/.
                  items: {}
                  type: array
                previousInteractionId:
                  description: >
                    The ID of an existing interaction to link the new
                    interaction to.
                  type: string
                subjectLine:
                  description: The subject line of the email.
                  type: string
                theme:
                  $ref: '#/components/schemas/InteractionTheme'
              required:
                - personalizations
              type: object
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        properties:
                          interactionId:
                            description: ID of the new interaction
                            type: string
                        type: object
                    type: object
          description: Accepted
      security:
        - oauth2:
            - communicator:send
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Send free-form email
      tags:
        - Communicator
  /communicator/subjects:
    get:
      description: >
        List all the currently available Interaction Subject descriptors.


        An interaction subject is the category or topic to which an interaction
        pertains.

        (Note this is different from the subject line of an email message.)


        For example, an email or a text message will necessarily contain
        different

        content due to their nature, but they still might pertain to

        the subject of `paymentReminder`. Similarly, a phone call despite not
        being

        text based at all might also pertain to the subject of
        `paymentReminder`.
      operationId: peach.communicator.handlers.subject_descriptors_list
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/SubjectDescriptor'
                type: array
          description: OK
      security:
        - oauth2:
            - communicator.template:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: List subject desciptors
      tags:
        - Communicator
  /communicator/subjects/{subject}:
    get:
      description: |
        Get the descriptor for a specific Interaction Subject.

        Note that subject descriptors do not have an `id` field but are
        instead identified by their unique `subject` field.
      operationId: peach.communicator.handlers.subject_descriptor_get_by_subject
      parameters:
        - $ref: '#/components/parameters/subject'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubjectDescriptor'
          description: OK
      security:
        - oauth2:
            - communicator.template:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get subject descriptor
      tags:
        - Communicator
    put:
      description: |
        Update the descriptor for a specific Interaction Subject.

        Note that subject descriptors do not have an `id` field but are
        instead identified by their unique `subject` field.
      operationId: peach.communicator.handlers.subject_descriptor_update
      parameters:
        - $ref: '#/components/parameters/subject'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubjectDescriptor'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubjectDescriptor'
          description: OK
      security:
        - oauth2:
            - communicator.template:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update subject descriptor
      tags:
        - Communicator
  /communicator/templatedescriptors:
    get:
      operationId: peach.communicator.handlers.list_template_descriptors
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/parameters-companyIdQuery'
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/TemplateDescriptor'
                type: array
          description: OK
        '400':
          description: Bad request
      security:
        - oauth2:
            - communicator.template:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: List template descriptors
      tags:
        - Templates
    post:
      operationId: peach.communicator.handlers.create_template_descriptor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateDescriptorMutate'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateDescriptor'
          description: OK
        '400':
          content:
            text/plain:
              schema:
                type: string
          description: Bad request
      security:
        - oauth2:
            - communicator.template:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create template descriptor
      tags:
        - Templates
  /communicator/templatedescriptors/{descriptorId}:
    delete:
      operationId: peach.communicator.handlers.delete_template_descriptor
      parameters:
        - $ref: '#/components/parameters/descriptorId'
      responses:
        '200':
          description: OK
        '404':
          content:
            text/plain:
              schema:
                type: string
          description: Not Found
      security:
        - oauth2:
            - communicator.template:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete template descriptor
      tags:
        - Templates
    get:
      operationId: peach.communicator.handlers.get_template_descriptor
      parameters:
        - $ref: '#/components/parameters/descriptorId'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateDescriptor'
          description: OK
        '400':
          description: Bad request
      security:
        - oauth2:
            - communicator.template:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get template descriptor
      tags:
        - Templates
    put:
      operationId: peach.communicator.handlers.update_template_descriptor
      parameters:
        - $ref: '#/components/parameters/descriptorId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateDescriptorMutate'
        description: The updated template descriptor
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateDescriptor'
          description: OK
        '400':
          content:
            text/plain:
              schema:
                type: string
          description: Bad request
      security:
        - oauth2:
            - communicator.template:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update template descriptor
      tags:
        - Templates
  /communicator/templatedescriptors/{descriptorId}/templates:
    get:
      description: List all template versions for the given template descriptor.
      operationId: peach.communicator.handlers.list_template_versions_by_descriptor
      parameters:
        - $ref: '#/components/parameters/descriptorId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/TemplateVersion'
                type: array
          description: OK
      security:
        - oauth2:
            - communicator.template:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: List template versions for descriptor
      tags:
        - Templates
  /communicator/templates:
    get:
      description: >
        List all template versions. 


        Deprecated in favor of `/v2/communicator/templates`.


        This dumps all template versions (regardless of active status) without
        paging.
      operationId: peach.communicator.handlers.list_template_versions
      parameters:
        - $ref: '#/components/parameters/parameters-companyIdQuery'
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/TemplateVersion'
                type: array
          description: OK
      security:
        - oauth2:
            - communicator.template:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: List all template versions (Deprecated)
      tags:
        - Templates
    post:
      description: >
        Create a new template versions.


        By default the new version will not be active until it is activated with

        <a
        href="/api-docs/api-public/templates/peach.communicator.handlers.activate_template_version">the
        activate endpoint</a>.

        Alternatively, pass `activate: true` in the request body to create and
        activate the

        version in a single call. Doing so requires the
        `communicator.template:activate`

        permission in addition to `communicator.template:create`.
      operationId: peach.communicator.handlers.create_template_version
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateVersionMutate'
        description: The new template
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateVersion'
          description: OK
        '400':
          content:
            text/plain:
              schema:
                type: string
          description: Bad request
      security:
        - oauth2:
            - communicator.template:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create template version
      tags:
        - Templates
  /communicator/templates/export:
    get:
      description: |
        Export all template descriptors and template versions for a company. 
        The export is in JSON format. It can be used with the import endpoint to
        restore templates.
      operationId: peach.communicator.handlers.export_templates
      parameters:
        - description: The company to export templates
          in: query
          name: companyId
          required: true
          schema:
            type: string
        - description: Export only active templates
          in: query
          name: activeOnly
          schema:
            default: true
            type: boolean
      responses:
        '200':
          content:
            application/json:
              schema:
                items: {}
                type: array
          description: OK
      security:
        - oauth2:
            - communicator.template:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Export all template descriptors and versions
      tags:
        - Templates
  /communicator/templates/import:
    post:
      description: >
        Import exported template descriptors and template versions for a
        company. The exported

        data should come from the `/communicator/templates/export` endpoint.


        The import will create new template descriptor if a matching one does
        not exist

        and will create new template versions if a matching one does not exist.
        This is often

        used to "promote" templates from a testing environment to a production
        environment.
      operationId: peach.communicator.handlers.import_templates
      parameters:
        - description: The company to import templates for
          in: query
          name: companyId
          required: true
          schema:
            type: string
        - description: |
            If an imported version data has new content and is marked active,
            activate the newly created template version.
          in: query
          name: allowActivate
          schema:
            default: true
            type: boolean
      requestBody:
        content:
          application/json:
            schema:
              items: {}
              type: array
        description: The exported template data
        required: true
      responses:
        '204':
          description: Successfully imported
      security:
        - oauth2:
            - communicator.template:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Import exported template descriptors and versions
      tags:
        - Templates
  /communicator/templates/{templateVersionId}:
    delete:
      deprecated: true
      description: >-
        Deleting template versions is not allowed. Template versions are
        historical records. This endpoint is retained for backwards
        compatibility but responds with a 400 error.
      operationId: peach.communicator.handlers.delete_template_version
      parameters:
        - $ref: '#/components/parameters/templateVersionId'
      responses:
        '400':
          content:
            text/plain:
              schema:
                type: string
          description: Bad request
      security:
        - oauth2:
            - communicator.template:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete template version (no longer supported)
      tags:
        - Templates
    get:
      operationId: peach.communicator.handlers.get_template_version
      parameters:
        - $ref: '#/components/parameters/templateVersionId'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateVersion'
          description: OK
      security:
        - oauth2:
            - communicator.template:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get template version
      tags:
        - Templates
    put:
      operationId: peach.communicator.handlers.update_template_version
      parameters:
        - $ref: '#/components/parameters/templateVersionId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateVersionMutate'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateVersion'
          description: OK
        '400':
          content:
            text/plain:
              schema:
                type: string
          description: Bad request
      security:
        - oauth2:
            - communicator.template:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update template version
      tags:
        - Templates
  /communicator/templates/{templateVersionId}/activate:
    put:
      description: >
        Set's the given template version as active.


        A template descriptor can have exactly one "active" version. The active
        template

        version is what's used to generate the content of the messages.
      operationId: peach.communicator.handlers.activate_template_version
      parameters:
        - $ref: '#/components/parameters/templateVersionId'
      responses:
        '200':
          description: OK
      security:
        - oauth2:
            - communicator.template:activate
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Activate template version
      tags:
        - Templates
  /communicator/templates/{templateVersionId}/preview:
    post:
      description: >
        Render the template contents of the given Template Version 

        using the given context.


        The three contents are returned in a single JSON response, they are
        `contentHtml`,

        `contentText` and `subjectLine`.
      operationId: peach.communicator.handlers.preview_template_version
      parameters:
        - $ref: '#/components/parameters/templateVersionId'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                context:
                  type: object
                personId:
                  $ref: '#/components/schemas/AnyId'
              required:
                - personId
              type: object
        description: Context data
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  contentHtml:
                    type: string
                  contentText:
                    type: string
                  subjectLine:
                    type: string
                type: object
          description: OK
      security:
        - oauth2:
            - communicator:render
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Render template version preview
      tags:
        - Templates
  /communicator/templates/{templateVersionId}/render:
    post:
      description: >
        Render a file (`text`, `html` or `pdf`) from this Template Version and
        download it.


        Only the content matching the `fmt` query parameter is returned in the
        file.


        The rendered template file is then downloaded as an attachment. (i.e., a

        response is sent with the header `Content-Disposition: attachment`.)


        Note: that a Document Descriptor is NOT created.
      operationId: peach.communicator.handlers.render_template_version
      parameters:
        - $ref: '#/components/parameters/templateVersionId'
        - $ref: '#/components/parameters/renderFormat'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/TemplateRender'
                - required:
                    - personId
                  type: object
        description: Template selectors and the data
        required: true
      responses:
        '200':
          content:
            application/pdf:
              schema:
                format: binary
                type: string
            text/html:
              schema:
                type: string
            text/plain:
              schema:
                type: string
          description: OK
      security:
        - oauth2:
            - communicator:render
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Render template version
      tags:
        - Templates
  /communicator/templates/{templateVersionId}/vars:
    get:
      description: >
        List all context variables used in the given template version.


        If a template looks like:
          
        ```

        Hello {{name}},


        Your loan {{loanName}} is due on {{dueDate}}.


        Thanks,

        {{companyName}}


        {{SOME_MACRO()}}

        ```


        The context variables are `name`, `loanName`, `dueDate` and
        `companyName` as

        well as whatever context variables are defined in `SOME_MACRO()` (but 

        `SOME_MACRO` itself is NOT a context variable). Note that this means

        sometimes a Template Version may contain many context variables since
        all possible

        context variables are included in this list.
      operationId: peach.communicator.handlers.get_template_vars
      parameters:
        - $ref: '#/components/parameters/templateVersionId'
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  type: string
                type: array
          description: OK
      security:
        - oauth2:
            - communicator.template:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: List context vars for template version
      tags:
        - Templates
  /companies/{companyId}/auth/saml/callback:
    post:
      operationId: peach.security.handlers.saml_sp_auth.idp_initiated
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/userTypeQuery'
        - $ref: '#/components/parameters/appDomainTypeQuery'
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              properties:
                RelayState:
                  type: string
                SAMLResponse:
                  type: string
              required:
                - SAMLResponse
              type: object
        required: true
      responses:
        '200':
          description: Success
      security: []
      summary: |
        SAML callback endpoint
      tags:
        - Auth
  /companies/{companyId}/auth/saml/help:
    get:
      operationId: peach.security.handlers.saml_sp_auth.idp_setup_help
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/userTypeQuery'
        - $ref: '#/components/parameters/appDomainTypeQuery'
      responses:
        '200':
          content:
            text/html:
              schema:
                type: string
          description: Success
      security: []
      summary: |
        Display IdP setup help
      tags:
        - Auth
  /companies/{companyId}/auth/saml/login:
    get:
      operationId: peach.security.handlers.saml_sp_auth.sp_initiated
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/userTypeQuery'
        - $ref: '#/components/parameters/appDomainTypeQuery'
        - description: >-
            If `true`, will return a URL to the login instead of redirecting to
            the login
          in: query
          name: returnUrl
          required: false
          schema:
            default: false
            type: boolean
      responses:
        '200':
          description: Success
      security: []
      summary: |
        Redirect to the SAML login endpoint
      tags:
        - Auth
  /companies/{companyId}/auth/saml/metadata.xml:
    get:
      description: |
        Peach acts as the service provider
      operationId: peach.security.handlers.saml_sp_auth.sp_metadata_xml
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/userTypeQuery'
        - $ref: '#/components/parameters/appDomainTypeQuery'
      responses:
        '200':
          content:
            text/xml:
              schema:
                type: object
          description: Success
      security: []
      summary: Display Peach SP Metadata
      tags:
        - Auth
  /companies/{companyId}/auth/send-one-time-code:
    post:
      description: >
        Send a one time code to a phone number or email address. For phone
        numbers, the code

        can be sent via text or voice.
      operationId: peach.security.handlers.send_one_time_code
      parameters:
        - $ref: '#/components/parameters/companyId'
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                channel:
                  $ref: '#/components/schemas/OneTimeCodeChannel'
                context:
                  description: >
                    Template specific properties to substitute in the
                    corresponding

                    ConfirmationCode template.
                  type: object
                force:
                  default: false
                  description: |
                    Force using the auth type of the user and not the company
                  type: boolean
                userType:
                  $ref: '#/components/schemas/UserType'
                username:
                  description: >
                    Either an email address or phone number. 


                    If the specified `channel` is `text` or `voice`, or the auth
                    type for the specified

                    `userType` is `oneTimeCodeText`, then this must be a valid
                    phone number. Otherwise,

                    it must be a valid email address.


                    This `username` is used to look up the user in the system. 


                    For agents:

                    - If the user belongs to an agent, then the given `username`
                    is used directly as the
                      recipient email address or phone number to text or call with the one time code.

                    For borrowers:

                    - If the user belongs to a borrower of type `business`, then
                    the given `username`
                      is used directly as the recipient email address or phone number to text or call
                      with the one time code.
                    - If the user belongs to a borrower of type `person`, then
                    borrower's primary
                      contact with `affiliation=self` is selected. And that value is 
                      used as the recipient email address or phone number to text or call with
                      the one time code.
                  type: string
              required:
                - username
                - channel
              type: object
        required: true
      responses:
        '202':
          description: >
            No input errors were found. i.e., The one time code *may* have been
            sent successfully.


            We do not reveal if a borrower is found and a message successfully
            sent in order to prevent

            an attacker from learning if the given phone number or email
            addresse is 

            in the system.
        '429':
          description: |
            This request has been rate limited; please try again later.
      security: []
      summary: |
        Send one time code.
      tags:
        - Auth
  /companies/{companyId}/campaigns/{borrowerCampaignId}/runs:
    get:
      description: |
        Get a list of campaign runs.
      operationId: peach.people.campaigns.handlers_runs.internal_campaign_run_list
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/borrowerCampaignId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
      responses:
        '200':
          $ref: '#/components/responses/BorrowerCampaignList'
      security:
        - oauth2:
            - borrowercampaign.run:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get campaign runs
      tags:
        - Campaigns
  /companies/{companyId}/collection-agencies:
    get:
      operationId: peach.collections.handlers.collection_agencies_list
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/includeArchived'
      responses:
        '200':
          $ref: '#/components/responses/CollectionAgencyPagingResponse'
      security:
        - oauth2:
            - collection.agency:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get collection agencies
      tags:
        - Collection Agencies
    post:
      description: >
        Creates a new collection agency. This is useful when a lender assigns a
        charged off loan to a third party debt collection agency.

        The Peach Borrower Portal will display the collection agency information
        to the borrower. The lender can continue to use Peach as the system

        of record / ledger for charged off loans. The lender can post any
        payments collected by the collection agency as `isExternal=true`
        transaction. 

        The Peach system will waterfall the payments and update loan balances.
      operationId: peach.collections.handlers.collection_agency_create
      parameters:
        - $ref: '#/components/parameters/companyId'
      requestBody:
        $ref: '#/components/requestBodies/CollectionAgencyPost'
      responses:
        '200':
          $ref: '#/components/responses/CollectionAgencyResponse'
      security:
        - oauth2:
            - collection.agency:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create collection agency
      tags:
        - Collection Agencies
  /companies/{companyId}/collection-agencies/{collectionAgencyId}:
    delete:
      description: Sets `isArchived = true` on the agency
      operationId: peach.collections.handlers.collection_agency_delete
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/collectionAgencyId'
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - collection.agency:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete collection agency
      tags:
        - Collection Agencies
    get:
      operationId: peach.collections.handlers.collection_agency_get
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/collectionAgencyId'
      responses:
        '200':
          $ref: '#/components/responses/CollectionAgencyResponse'
      security:
        - oauth2:
            - collection.agency:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get collection agency by ID
      tags:
        - Collection Agencies
    put:
      operationId: peach.collections.handlers.collection_agency_update
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/collectionAgencyId'
      requestBody:
        $ref: '#/components/requestBodies/CollectionAgencyPut'
      responses:
        '200':
          $ref: '#/components/responses/CollectionAgencyResponse'
      security:
        - oauth2:
            - collection.agency:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update collection agency
      tags:
        - Collection Agencies
  /companies/{companyId}/credit-agencies:
    get:
      operationId: peach.credit_reporting.handlers.credit_agencies_list
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/uploadedByLender'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
      responses:
        '200':
          $ref: '#/components/responses/CreditAgencyPagingResponse'
      security:
        - oauth2:
            - credit.agency:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get credit agencies
      tags:
        - Credit Agencies
    post:
      description: Creates a new credit agency.
      operationId: peach.credit_reporting.handlers.credit_agency_create
      parameters:
        - $ref: '#/components/parameters/companyId'
      requestBody:
        $ref: '#/components/requestBodies/CreditAgencyPost'
      responses:
        '200':
          $ref: '#/components/responses/CreditAgencyResponse'
      security:
        - oauth2:
            - credit.agency:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create credit agency
      tags:
        - Credit Agencies
  /companies/{companyId}/credit-agencies/{creditAgencyId}:
    get:
      operationId: peach.credit_reporting.handlers.credit_agency_get
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/creditAgencyId'
      responses:
        '200':
          $ref: '#/components/responses/CreditAgencyResponse'
      security:
        - oauth2:
            - credit.agency:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get credit agency by ID
      tags:
        - Credit Agencies
    put:
      operationId: peach.credit_reporting.handlers.credit_agency_update
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/creditAgencyId'
      requestBody:
        $ref: '#/components/requestBodies/CreditAgencyPut'
      responses:
        '200':
          $ref: '#/components/responses/CreditAgencyResponse'
      security:
        - oauth2:
            - credit.agency:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update credit agency
      tags:
        - Credit Agencies
  /companies/{companyId}/credit-agencies/{creditAgencyId}/regenerate-ssh-keys:
    post:
      description: >
        Generates a new RSA SSH key pair for the credit agency and returns the
        updated object.

        The new `sftpSSHPeachPublicKey` must be added to the SFTP server's
        `authorized_keys` file —

        the old public key will no longer work after this call.
      operationId: peach.credit_reporting.handlers.credit_agency_regenerate_ssh_keys
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/creditAgencyId'
      responses:
        '200':
          $ref: '#/components/responses/CreditAgencyResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          description: Forbidden
        '404':
          $ref: '#/components/responses/NotFoundError'
      security:
        - oauth2:
            - credit.agency:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Regenerate SSH key pair for credit agency
      tags:
        - Credit Agencies
  /companies/{companyId}/interactions/{interactionId}/call-transcripts/summaries:
    get:
      operationId: >-
        peach.ai.call_transcription.handlers.internal_unbound_interaction_call_summary_results_get_by_interaction
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/interactionId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/callTranscriptionResultStatus'
        - $ref: '#/components/parameters/aICallTranscriptionResultIdFilter'
      responses:
        '200':
          $ref: '#/components/responses/CallSummaryResultsPaging'
      security:
        - oauth2:
            - interaction:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get interaction call summaries
      tags:
        - Interactions
  /companies/{companyId}/interactions/{interactionId}/previous:
    get:
      description: |
        For this interaction, get all the previous interactions linked to it
        via the `previousInteractionId` field.
      operationId: >-
        peach.people.interaction.handlers.internal_unbound_get_many_previous_interactions
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/interactionId'
        - $ref: '#/components/parameters/parameters-includeFields'
      responses:
        '200':
          $ref: '#/components/responses/InteractionsManyNoPaging'
      security:
        - oauth2:
            - interaction:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get previous interactions
      tags:
        - Interactions
  /companies/{companyId}/investors:
    get:
      description: Get all investors under the given company.
      operationId: peach.payment_instruments.handlers.investor_get_all
      parameters:
        - $ref: '#/components/parameters/companyId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Paging'
                  - properties:
                      count:
                        format: int32
                        type: integer
                      data:
                        items:
                          $ref: '#/components/schemas/Investor'
                        type: array
                    required:
                      - count
                      - items
                    type: object
                title: rules
          description: success
      security:
        - oauth2:
            - investor:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get investors
      tags:
        - Investors
    post:
      description: |
        Create an investor under the umbrella of the given company.
      operationId: peach.payment_instruments.handlers.investor_create
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/contactValidate'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Investor'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Investor'
          description: created
      security:
        - oauth2:
            - investor:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create investor
      tags:
        - Investors
  /companies/{companyId}/investors/{investorId}:
    get:
      operationId: peach.payment_instruments.handlers.investor_get
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/investorId'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Investor'
          description: success
      security:
        - oauth2:
            - investor:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get investor by ID
      tags:
        - Investors
    put:
      operationId: peach.payment_instruments.handlers.investor_update
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/investorId'
        - $ref: '#/components/parameters/contactValidate'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvestorMutable'
        required: true
      responses:
        '204':
          description: updated
      security:
        - oauth2:
            - investor:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update investor
      tags:
        - Investors
  /companies/{companyId}/investors/{investorId}/settlement-instruments:
    get:
      description: >
        Returns all settlement instruments registered for an investor. These are
        the bank accounts

        the Peach payment processor will wire investor settlement proceeds to.
      operationId: peach.payment_instruments.handlers.settlement_instrument_get_all
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/investorId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Paging'
                  - properties:
                      count:
                        format: int32
                        type: integer
                      data:
                        items:
                          $ref: '#/components/schemas/SettlementInstrument'
                        type: array
                    required:
                      - count
                      - data
                    type: object
                title: Settlement Instruments
          description: Settlement Instruments
      security:
        - oauth2:
            - settlement.instrument:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get settlement instruments
      tags:
        - Settlement Instruments
    post:
      description: >
        Registers a bank account as a settlement instrument for an investor. The
        Peach payment

        processor will use this account to wire the investor's share of
        collected borrower payments

        as part of automated daily investor settlement.
      operationId: peach.payment_instruments.handlers.settlement_instrument_create
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/investorId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SettlementInstrument'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/SettlementInstrument'
                    type: object
          description: Settlement Instrument Created
      security:
        - oauth2:
            - settlement.instrument:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create settlement instrument
      tags:
        - Settlement Instruments
  /companies/{companyId}/investors/{investorId}/settlement-instruments/{settlementInstrumentId}:
    get:
      operationId: peach.payment_instruments.handlers.settlement_instrument_get
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/investorId'
        - $ref: '#/components/parameters/settlementInstrumentId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/SettlementInstrument'
                    type: object
          description: Payment Instrument
      security:
        - oauth2:
            - settlement.instrument:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get settlement instrument by ID
      tags:
        - Settlement Instruments
    put:
      operationId: peach.payment_instruments.handlers.settlement_instrument_update
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/investorId'
        - $ref: '#/components/parameters/settlementInstrumentId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SettlementInstrumentMutable'
        required: true
      responses:
        '204':
          description: Settlement Instrument Updated
      security:
        - oauth2:
            - settlement.instrument:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update settlement instrument
      tags:
        - Settlement Instruments
  /companies/{companyId}/loan-labels:
    get:
      operationId: peach.loans.labels.handlers.loan_labels_list
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/parameters-createdBefore'
        - $ref: '#/components/parameters/parameters-createdAfter'
        - $ref: '#/components/parameters/loanFilter'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
      responses:
        '200':
          $ref: '#/components/responses/LoanLabelPagingResponse'
      security:
        - oauth2:
            - loan.label:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan labels
      tags:
        - Loan Labels
    post:
      description: Creates a new loan label.
      operationId: peach.loans.labels.handlers.loan_label_create
      parameters:
        - $ref: '#/components/parameters/companyId'
      requestBody:
        $ref: '#/components/requestBodies/LoanLabelPost'
      responses:
        '200':
          $ref: '#/components/responses/LoanLabelResponse'
      security:
        - oauth2:
            - loan.label:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create loan label
      tags:
        - Loan Labels
  /companies/{companyId}/loan-labels/{loanLabelIds}/loans:
    get:
      operationId: peach.loans.labels.handlers.loan_labels_get_loans
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/loanLabelIds'
      responses:
        '200':
          $ref: '#/components/responses/LoanIdsResponse'
      security:
        - oauth2:
            - loan.label:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loans by loan labels
      tags:
        - Loan Labels
    put:
      description: Adds loans to the specified labels.
      operationId: peach.loans.labels.handlers.loan_labels_add_loans
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/loanLabelIds'
      requestBody:
        $ref: '#/components/requestBodies/LoanIdsPut'
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - loan.label:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Add labels to loans
      tags:
        - Loan Labels
  /companies/{companyId}/loan-labels/{loanLabelIds}/loans/remove:
    put:
      description: Remove loans from the specified labels.
      operationId: peach.loans.labels.handlers.loan_labels_remove_loans
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/loanLabelIds'
      requestBody:
        $ref: '#/components/requestBodies/LoanIdsPut'
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - loan.label:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Remove labels from loans
      tags:
        - Loan Labels
  /companies/{companyId}/loan-labels/{loanLabelId}:
    delete:
      operationId: peach.loans.labels.handlers.loan_label_delete
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/loanLabelId'
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - loan.label:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete loan label
      tags:
        - Loan Labels
    get:
      operationId: peach.loans.labels.handlers.loan_label_get
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/loanLabelId'
      responses:
        '200':
          $ref: '#/components/responses/LoanLabelResponse'
      security:
        - oauth2:
            - loan.label:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan label by ID
      tags:
        - Loan Labels
    put:
      description: Updates a loan label.
      operationId: peach.loans.labels.handlers.loan_label_update
      parameters:
        - $ref: '#/components/parameters/loanLabelId'
        - $ref: '#/components/parameters/companyId'
      requestBody:
        $ref: '#/components/requestBodies/LoanLabelPut'
      responses:
        '200':
          $ref: '#/components/responses/LoanLabelResponse'
      security:
        - oauth2:
            - loan.label:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update loan label
      tags:
        - Loan Labels
  /companies/{companyId}/loan-tape-types:
    get:
      operationId: peach.loans.tape.handlers.loan_tape_types_list
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
      responses:
        '200':
          $ref: '#/components/responses/LoanTapeTypePagingResponse'
      security:
        - oauth2:
            - loan.tape.type:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan tape types
      tags:
        - Loan Tape Types
    post:
      description: Creates a new loan tape type.
      operationId: peach.loans.tape.handlers.loan_tape_type_create
      parameters:
        - $ref: '#/components/parameters/companyId'
      requestBody:
        $ref: '#/components/requestBodies/LoanTapeTypePost'
      responses:
        '200':
          $ref: '#/components/responses/LoanTapeTypeResponse'
      security:
        - oauth2:
            - loan.tape.type:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create loan tape type
      tags:
        - Loan Tape Types
  /companies/{companyId}/loan-tape-types/{loanTapeTypeId}:
    delete:
      operationId: peach.loans.tape.handlers.loan_tape_type_delete
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/loanTapeTypeId'
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - loan.tape.type:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete loan tape type
      tags:
        - Loan Tape Types
    get:
      operationId: peach.loans.tape.handlers.loan_tape_type_get
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/loanTapeTypeId'
      responses:
        '200':
          $ref: '#/components/responses/LoanTapeTypeResponse'
      security:
        - oauth2:
            - loan.tape.type:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan tape type by ID
      tags:
        - Loan Tape Types
    put:
      operationId: peach.loans.tape.handlers.loan_tape_type_update
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/loanTapeTypeId'
      requestBody:
        $ref: '#/components/requestBodies/LoanTapeTypePut'
      responses:
        '200':
          $ref: '#/components/responses/LoanTapeTypeResponse'
      security:
        - oauth2:
            - loan.tape.type:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update loan tape type
      tags:
        - Loan Tape Types
  /companies/{companyId}/loan-tapes:
    get:
      operationId: peach.loans.tape.handlers.loan_tapes_list
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/untokenize'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
      responses:
        '200':
          $ref: '#/components/responses/LoanTapePagingResponse'
      security:
        - oauth2:
            - loan.tape:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan tapes
      tags:
        - Loan Tapes
    post:
      description: Creates a new loan tape.
      operationId: peach.loans.tape.handlers.loan_tape_create
      parameters:
        - $ref: '#/components/parameters/companyId'
      requestBody:
        $ref: '#/components/requestBodies/LoanTapePost'
      responses:
        '200':
          $ref: '#/components/responses/LoanTapeResponse'
      security:
        - oauth2:
            - loan.tape:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create loan tape
      tags:
        - Loan Tapes
  /companies/{companyId}/loan-tapes/generate:
    post:
      operationId: peach.loans.tape.handlers.loan_tapes_generate
      parameters:
        - $ref: '#/components/parameters/companyId'
      requestBody:
        $ref: '#/components/requestBodies/LoanTapeGeneratePost'
      responses:
        '201':
          $ref: '#/components/responses/LoanTapeGeneratePostResponse'
      security:
        - oauth2:
            - loan.tape:generate
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Generate Loan Tapes
      tags:
        - Loan Tapes
  /companies/{companyId}/loan-tapes/{loanTapeId}:
    delete:
      operationId: peach.loans.tape.handlers.loan_tape_delete
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/loanTapeId'
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - loan.tape:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete loan tape
      tags:
        - Loan Tapes
    get:
      operationId: peach.loans.tape.handlers.loan_tape_get
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/loanTapeId'
        - $ref: '#/components/parameters/untokenize'
      responses:
        '200':
          $ref: '#/components/responses/LoanTapeResponse'
      security:
        - oauth2:
            - loan.tape:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan tape by ID
      tags:
        - Loan Tapes
    put:
      operationId: peach.loans.tape.handlers.loan_tape_update
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/loanTapeId'
      requestBody:
        $ref: '#/components/requestBodies/LoanTapePut'
      responses:
        '200':
          $ref: '#/components/responses/LoanTapeResponse'
      security:
        - oauth2:
            - loan.tape:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update loan tape
      tags:
        - Loan Tapes
  /companies/{companyId}/loan-tapes/{loanTapeId}/records:
    get:
      description: Records are sorted by `createdAt` descending
      operationId: peach.loans.tape.handlers.loan_tape_records_list
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/loanTapeId'
      responses:
        '200':
          $ref: '#/components/responses/LoanTapeRecordPagingResponse'
      security:
        - oauth2:
            - loan.tape.record:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan tape records
      tags:
        - Loan Tapes
  /companies/{companyId}/loan-types/{loanTypeId}/repayment-engine/notifications:
    get:
      operationId: peach.repayment_engine.handlers.get_notification_types_internal
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/loanTypeId'
        - in: query
          name: trigger
          schema:
            $ref: '#/components/schemas/RepaymentNotificationTrigger'
        - in: query
          name: subject
          schema:
            $ref: '#/components/schemas/RepaymentEngineInteractionSubject'
        - in: query
          name: status
          schema:
            enum:
              - active
              - inactive
            type: string
        - $ref: '#/components/parameters/sendChannels'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/RepaymentNotificationType'
                        type: array
                    type: object
          description: Success
      security:
        - oauth2:
            - repaymentengine.notification:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get product notification types
      tags:
        - Repayment Engine
    post:
      operationId: peach.repayment_engine.handlers.create_notification_type_internal
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/loanTypeId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RepaymentNotificationType'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/RepaymentNotificationType'
                    type: object
          description: Created
      security:
        - oauth2:
            - repaymentengine.notification:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create a notification type
      tags:
        - Repayment Engine
  /companies/{companyId}/loan-types/{loanTypeId}/repayment-engine/{repaymentNotificationTypeId}:
    delete:
      operationId: peach.repayment_engine.handlers.delete_notification_type_internal
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/loanTypeId'
        - $ref: '#/components/parameters/repaymentNotificationTypeId'
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - repaymentengine.notification:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete a notification type
      tags:
        - Repayment Engine
    get:
      operationId: peach.repayment_engine.handlers.get_notification_type_by_id
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/loanTypeId'
        - $ref: '#/components/parameters/repaymentNotificationTypeId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/RepaymentNotificationType'
                    type: object
          description: Success
      security:
        - oauth2:
            - repaymentengine.notification:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get notification type by ID
      tags:
        - Repayment Engine
    put:
      operationId: peach.repayment_engine.handlers.update_notification_type_internal
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/loanTypeId'
        - $ref: '#/components/parameters/repaymentNotificationTypeId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RepaymentNotificationTypeWithoutSubject'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/RepaymentNotificationType'
                    type: object
          description: Updated
      security:
        - oauth2:
            - repaymentengine.notification:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update a notification type
      tags:
        - Repayment Engine
  /companies/{companyId}/loans/{loanId}/promise-to-pay-plans/{promiseToPayPlanId}/evaluate:
    put:
      description: >-
        Evaluates a `Promise to Pay Plan` and updates the `status` and
        `isOverdue` of the `Promise to Pay Plan`.
      operationId: >-
        peach.loans.promise_to_pays.handlers.internal_evaluate_promise_to_pay_plan
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/promiseToPayPlanId'
      responses:
        '200':
          $ref: '#/components/responses/PromiseToPayPlan'
          description: Successfully evaluated the Promise to Pay Plan.
      security:
        - oauth2:
            - promise.to.pay.plan:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Evaluate Promise to Pay Plan, does not require personId
      tags:
        - Promise to Pay Plans
  /companies/{companyId}/merchants:
    get:
      operationId: peach.merchants.handlers.merchants_list
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/parentMerchantId'
      responses:
        '200':
          $ref: '#/components/responses/MerchantPagingResponse'
      security:
        - oauth2:
            - merchant:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get merchants
      tags:
        - Merchants
    post:
      description: Creates a new merchant.
      operationId: peach.merchants.handlers.merchant_create
      parameters:
        - $ref: '#/components/parameters/companyId'
      requestBody:
        $ref: '#/components/requestBodies/MerchantPost'
      responses:
        '200':
          $ref: '#/components/responses/MerchantResponse'
      security:
        - oauth2:
            - merchant:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create merchant
      tags:
        - Merchants
  /companies/{companyId}/merchants/{merchantId}:
    get:
      operationId: peach.merchants.handlers.merchant_get
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/merchantId'
      responses:
        '200':
          $ref: '#/components/responses/MerchantResponse'
      security:
        - oauth2:
            - merchant:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get merchant by ID
      tags:
        - Merchants
    put:
      operationId: peach.merchants.handlers.merchant_update
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/merchantId'
      requestBody:
        $ref: '#/components/requestBodies/MerchantPut'
      responses:
        '200':
          $ref: '#/components/responses/MerchantResponse'
      security:
        - oauth2:
            - merchant:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update merchant
      tags:
        - Merchants
  /companies/{companyId}/payment-processors/{paymentProcessorId}/ach-files/{achFileId}/content:
    get:
      operationId: peach.payment_processors.handlers.get_ach_file_content
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/paymentProcessorId'
        - $ref: '#/components/parameters/achFileId'
        - description: >-
            If `true`, will return a URL to the content instead of redirecting
            to the content.
          in: query
          name: returnUrl
          required: false
          schema:
            default: false
            type: boolean
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/AchFile'
                    type: object
          description: Success
      security:
        - oauth2:
            - ach.file:download
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get ACH file content
      tags:
        - ACH File
  /companies/{companyId}/payment-processors/{paymentProcessorId}/funding-instruments:
    get:
      operationId: peach.payment_instruments.handlers.funding_instrument_get_all
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/paymentProcessorId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Paging'
                  - properties:
                      count:
                        format: int32
                        type: integer
                      data:
                        items:
                          $ref: '#/components/schemas/FundingInstrument'
                        type: array
                    required:
                      - count
                      - data
                    type: object
                title: Funding Instruments
          description: Funding Instruments
      security:
        - oauth2:
            - funding.instrument:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get funding instruments
      tags:
        - Funding Instruments
    post:
      operationId: peach.payment_instruments.handlers.funding_instrument_create
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/paymentProcessorId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FundingInstrument'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/FundingInstrument'
                    type: object
          description: Funding Instrument Created
      security:
        - oauth2:
            - funding.instrument:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create funding instrument
      tags:
        - Funding Instruments
  /companies/{companyId}/payment-processors/{paymentProcessorId}/funding-instruments/{fundingInstrumentId}:
    get:
      operationId: peach.payment_instruments.handlers.funding_instrument_get
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/paymentProcessorId'
        - $ref: '#/components/parameters/fundingInstrumentId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/FundingInstrument'
                    type: object
          description: Payment Instrument
      security:
        - oauth2:
            - funding.instrument:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get funding instrument by ID
      tags:
        - Funding Instruments
    put:
      operationId: peach.payment_instruments.handlers.funding_instrument_update
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/paymentProcessorId'
        - $ref: '#/components/parameters/fundingInstrumentId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FundingInstrumentMutable'
        required: true
      responses:
        '204':
          description: Funding Instrument Updated
      security:
        - oauth2:
            - funding.instrument:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update funding instrument
      tags:
        - Funding Instruments
  /companies/{companyId}/people/{personId}/cases/{caseId}/workflow:
    get:
      operationId: peach.workflows.handlers.get_case_workflow
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/Workflow'
                    type: object
          description: OK
      security:
        - oauth2:
            - workflow:create
            - workflow:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get case workflow
      tags:
        - Workflows
  /companies/{companyId}/people/{personId}/cases/{caseId}/workflow/steps/{workflowStepId}:
    put:
      operationId: peach.workflows.handlers.update_workflow_step
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseId'
        - $ref: '#/components/parameters/workflowStepId'
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                status:
                  $ref: '#/components/schemas/WorkflowStepStatus'
                  required: true
              type: object
        required: true
      responses:
        '204':
          description: No Content
      security:
        - oauth2:
            - workflow:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update workflow step status
      tags:
        - Workflows
  /companies/{companyId}/people/{personId}/cases/{caseId}/workflow/steps/{workflowStepId}/workitems/{workflowWorkitemId}:
    put:
      operationId: peach.workflows.handlers.update_workflow_workitem
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseId'
        - $ref: '#/components/parameters/workflowStepId'
        - $ref: '#/components/parameters/workflowWorkitemId'
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                status:
                  $ref: '#/components/schemas/WorkflowWorkitemStatus'
                  required: true
              type: object
        required: true
      responses:
        '204':
          description: No Content
      security:
        - oauth2:
            - workflow:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update workflow workitem status
      tags:
        - Workflows
  /companies/{companyId}/people/{personId}/loans/{loanId}/investors:
    get:
      operationId: peach.people.loans.handlers.internal_loan_investors_get_all
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoanInvestorsPaging'
          description: success
      security:
        - oauth2:
            - loan:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan investors
      tags:
        - Investors
  /companies/{companyId}/promo-program-types:
    get:
      operationId: >-
        peach.promo_programs.handlers.promo_program_type.internal_promo_program_types_get_all
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/promoProgramTypeStatus'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/sortBy'
      responses:
        '200':
          $ref: '#/components/responses/PromoProgramTypePaging'
      security:
        - oauth2:
            - loan.promoprogram.type:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get promo program types
      tags:
        - Promo Programs Type
    post:
      operationId: >-
        peach.promo_programs.handlers.promo_program_type.internal_promo_program_types_add
      parameters:
        - $ref: '#/components/parameters/companyId'
      requestBody:
        $ref: '#/components/requestBodies/PromoProgramTypePost'
      responses:
        '200':
          $ref: '#/components/responses/PromoProgramType'
      security:
        - oauth2:
            - loan.promoprogram.type:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create promo program type
      tags:
        - Promo Programs Type
  /companies/{companyId}/promo-program-types/{promoProgramTypeId}:
    delete:
      operationId: >-
        peach.promo_programs.handlers.promo_program_type.internal_promo_program_types_delete
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/promoProgramTypeId'
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - loan.promoprogram.type:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Cancel promo program type
      tags:
        - Promo Programs Type
    get:
      operationId: >-
        peach.promo_programs.handlers.promo_program_type.internal_promo_program_types_get
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/promoProgramTypeId'
      responses:
        '200':
          $ref: '#/components/responses/PromoProgramType'
      security:
        - oauth2:
            - loan.promoprogram.type:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get promo program type by ID
      tags:
        - Promo Programs Type
    put:
      operationId: >-
        peach.promo_programs.handlers.promo_program_type.internal_promo_program_types_update
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/promoProgramTypeId'
      requestBody:
        $ref: '#/components/requestBodies/PromoProgramTypePut'
      responses:
        '200':
          $ref: '#/components/responses/PromoProgramType'
      security:
        - oauth2:
            - loan.promoprogram.type:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update promo program type
      tags:
        - Promo Programs Type
  /companies/{companyId}/repayment-engine/notifications:
    get:
      operationId: peach.repayment_engine.handlers.get_notification_types_by_company
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/sortBy'
        - in: query
          name: productId
          schema:
            $ref: '#/components/schemas/AnyId'
        - in: query
          name: trigger
          schema:
            $ref: '#/components/schemas/RepaymentNotificationTrigger'
        - in: query
          name: subject
          schema:
            $ref: '#/components/schemas/RepaymentEngineInteractionSubject'
        - in: query
          name: status
          schema:
            enum:
              - active
              - inactive
            type: string
        - in: query
          name: dayType
          schema:
            $ref: '#/components/schemas/DayType'
        - $ref: '#/components/parameters/sendChannels'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/NewPaginator'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/RepaymentNotificationType'
                        type: array
                    type: object
          description: Success
      security:
        - oauth2:
            - repaymentengine.notification:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get all company notification types
      tags:
        - Repayment Engine
  /companies/{companyId}/repayment-engine/products-with-notifications:
    get:
      operationId: peach.repayment_engine.handlers.get_products_with_notifications
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/sortBy'
        - in: query
          name: trigger
          schema:
            $ref: '#/components/schemas/RepaymentNotificationTrigger'
        - in: query
          name: subject
          schema:
            $ref: '#/components/schemas/RepaymentEngineInteractionSubject'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/NewPaginator'
                  - properties:
                      data:
                        items:
                          properties:
                            loanTypeAssetName:
                              type: string
                            productId:
                              type: string
                          type: object
                        type: array
                    type: object
          description: Success
      security:
        - oauth2:
            - repaymentengine.notification:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get all products with notifications for a company
      tags:
        - Repayment Engine
  /companies/{companyId}/repayment-engine/subjects-with-notifications:
    get:
      operationId: peach.repayment_engine.handlers.get_subjects_with_notifications
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/sortBy'
        - in: query
          name: productId
          required: false
          schema:
            $ref: '#/components/schemas/AnyId'
        - in: query
          name: trigger
          required: false
          schema:
            $ref: '#/components/schemas/RepaymentNotificationTrigger'
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    items:
                      $ref: '#/components/schemas/RepaymentEngineInteractionSubject'
                    type: array
                type: object
          description: Success
      security:
        - oauth2:
            - repaymentengine.notification:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get distinct subjects with notifications for a company
      tags:
        - Repayment Engine
  /companies/{companyId}/repayment-engine/triggers-with-notifications:
    get:
      operationId: peach.repayment_engine.handlers.get_triggers_with_notifications
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/sortBy'
        - in: query
          name: productId
          required: false
          schema:
            $ref: '#/components/schemas/AnyId'
        - in: query
          name: subject
          required: false
          schema:
            $ref: '#/components/schemas/RepaymentEngineInteractionSubject'
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    items:
                      $ref: '#/components/schemas/RepaymentNotificationTrigger'
                    type: array
                type: object
          description: Success
      security:
        - oauth2:
            - repaymentengine.notification:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get distinct triggers with notifications for a company
      tags:
        - Repayment Engine
  /companies/{companyId}/task-worker-pairing-configs:
    get:
      description: |
        List the task-worker pairing configs for a company.
      operationId: >-
        peach.twilio.taskrouter.handlers_task_worker_pairing_configs.task_worker_pairing_config_list
      parameters:
        - $ref: '#/components/parameters/taskWorkerPairingConfigSortBy'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/companyId'
      responses:
        '200':
          $ref: '#/components/responses/TaskWorkerPairingConfigPaging'
      security:
        - oauth2:
            - twpc:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: List task-worker pairing configs
      tags:
        - Task-Worker Pairing Configs
    post:
      description: >
        Create a new task-worker pairing config.


        Changes here will not take effect until synchronization is run. See:

        <a
        href="/api-docs/api-public/task-worker-pairing-configs/peach.twilio.taskrouter.handlers_task_worker_pairing_configs.task_worker_pairing_config_sync">Sync
        task-worker pairing configs to Twilio</a>
      operationId: >-
        peach.twilio.taskrouter.handlers_task_worker_pairing_configs.task_worker_pairing_config_create
      parameters:
        - $ref: '#/components/parameters/companyId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskWorkerPairingConfig'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/TaskWorkerPairingConfig'
      security:
        - oauth2:
            - twpc:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: |
        Create task-worker pairing config
      tags:
        - Task-Worker Pairing Configs
  /companies/{companyId}/task-worker-pairing-configs/sync:
    post:
      description: >
        Perform synchronization of task-worker pairing config to Twilio. 


        API changes to task-worker pairing configs will have no effect until
        this synchronization is run.
      operationId: >-
        peach.twilio.taskrouter.handlers_task_worker_pairing_configs.task_worker_pairing_config_sync
      parameters:
        - $ref: '#/components/parameters/companyId'
      responses:
        '200':
          description: Success
      security:
        - oauth2:
            - twpc:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Sync task-worker pairing configs to Twilio
      tags:
        - Task-Worker Pairing Configs
  /companies/{companyId}/task-worker-pairing-configs/{taskWorkerPairingConfigId}:
    delete:
      description: >
        Delete a task-worker pairing config.


        Changes here will not take effect until synchronization is run. See:

        <a
        href="/api-docs/api-public/task-worker-pairing-configs/peach.twilio.taskrouter.handlers_task_worker_pairing_configs.task_worker_pairing_config_sync">Sync
        task-worker pairing configs to Twilio</a>
      operationId: >-
        peach.twilio.taskrouter.handlers_task_worker_pairing_configs.task_worker_pairing_config_delete
      parameters:
        - $ref: '#/components/parameters/taskWorkerPairingConfigId'
        - $ref: '#/components/parameters/companyId'
      responses:
        '204':
          description: Delete ok
      security:
        - oauth2:
            - twpc:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete task-worker pairing config
      tags:
        - Task-Worker Pairing Configs
    get:
      operationId: >-
        peach.twilio.taskrouter.handlers_task_worker_pairing_configs.task_worker_pairing_config_get
      parameters:
        - $ref: '#/components/parameters/taskWorkerPairingConfigId'
        - $ref: '#/components/parameters/companyId'
      responses:
        '200':
          $ref: '#/components/responses/TaskWorkerPairingConfig'
      security:
        - oauth2:
            - twpc:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get task-worker pairing config
      tags:
        - Task-Worker Pairing Configs
    put:
      description: >
        Update a task-worker pairing config.


        Changes here will not take effect until synchronization is run. See:

        <a
        href="/api-docs/api-public/task-worker-pairing-configs/peach.twilio.taskrouter.handlers_task_worker_pairing_configs.task_worker_pairing_config_sync">Sync
        task-worker pairing configs to Twilio</a>
      operationId: >-
        peach.twilio.taskrouter.handlers_task_worker_pairing_configs.task_worker_pairing_config_update
      parameters:
        - $ref: '#/components/parameters/taskWorkerPairingConfigId'
        - $ref: '#/components/parameters/companyId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskWorkerPairingConfig'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/TaskWorkerPairingConfig'
      security:
        - oauth2:
            - twpc:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update task-worker pairing config
      tags:
        - Task-Worker Pairing Configs
  /companies/{companyId}/twilio-queues:
    get:
      description: >-
        Get information on task queues such as friendly name and task
        statistics.
      operationId: peach.twilio.taskrouter.handlers.get_all_queues
      parameters:
        - $ref: '#/components/parameters/companyId'
      responses:
        '200':
          $ref: '#/components/responses/TaskQueueData'
      security:
        - oauth2:
            - taskrouter.task.unterminated:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get information on Twilio task queues
      tags:
        - Tasks
  /companies/{companyId}/twilio-terminated-tasks:
    get:
      operationId: peach.twilio.taskrouter.handlers_task_history.task_history_list
      parameters:
        - $ref: '#/components/parameters/companyId'
      responses:
        '200':
          description: Success
      security:
        - oauth2:
            - taskrouter.task.terminated:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: List Terminated Tasks
      tags:
        - Tasks
  /companies/{companyId}/twilio-terminated-tasks/{taskHistoryId}:
    get:
      operationId: peach.twilio.taskrouter.handlers_task_history.task_history_get
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/taskHistoryId'
      responses:
        '200':
          description: Success
      security:
        - oauth2:
            - taskrouter.task.terminated:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get Terminated Task by ID
      tags:
        - Tasks
  /companies/{companyId}/twilio-terminated-tasks/{taskHistoryId}/clone:
    post:
      operationId: peach.twilio.taskrouter.handlers_task_history.task_history_clone
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/taskHistoryId'
      responses:
        '200':
          description: Success
      security:
        - oauth2:
            - taskrouter.task.unterminated:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Clone Terminated Task by ID
      tags:
        - Tasks
  /companies/{companyId}/twilio-unterminated-tasks:
    delete:
      description: >
        Bulk delete unterminated tasks from Twilio API. (this proxy's Twilio's

        Task API).


        An "unterminated" task is an "active" task—or any task which has yet to
        have its

        task assignment status set to `completed` or `canceled`. See:
        https://www.twilio.com/docs/taskrouter/lifecycle-task-state
      operationId: peach.twilio.taskrouter.handlers.delete_unterminated_tasks
      parameters:
        - $ref: '#/components/parameters/companyId'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                taskSids:
                  description: |
                    List of task SIDs to delete.
                  items:
                    type: string
                  type: array
              type: object
        required: true
      responses:
        '200':
          $ref: '#/components/responses/SingletonResponse'
      security:
        - oauth2:
            - taskrouter.task.unterminated:bulk.delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Bulk Delete Unterminated Tasks
      tags:
        - Tasks
    get:
      description: >
        Reads unterminated task from Twilio API. (This essentially proxies
        Twilio's

        Task API).


        Note that paging works differently on this endpoint in order for
        compatibility

        with the Twilio API—but you can still use `nextUrl` and `previousUrl`


        An "unterminated" task is an "active" task—or any task which has yet to
        have its

        task assignment status set to `completed` or `canceled`. See:
        https://www.twilio.com/docs/taskrouter/lifecycle-task-state
      operationId: peach.twilio.taskrouter.handlers.list_unterminated_tasks
      parameters:
        - $ref: '#/components/parameters/companyId'
        - description: >
            Fields to include in the response.


            If `reservation` include information on the task's current
            reservation in the field `reservation`
          explode: false
          in: query
          name: include
          required: false
          schema:
            items:
              enum:
                - reservation
              type: string
            type: array
          style: form
        - $ref: '#/components/parameters/sortBy'
        - $ref: '#/components/parameters/taskQueueSid'
        - $ref: '#/components/parameters/taskAssignmentStatus'
        - $ref: '#/components/parameters/taskType'
        - $ref: '#/components/parameters/parameters-caseType'
        - $ref: '#/components/parameters/parameters-caseId'
        - $ref: '#/components/parameters/supercaseId'
        - $ref: '#/components/parameters/parameters-interactionId'
        - $ref: '#/components/parameters/unableToComplete'
        - $ref: '#/components/parameters/taskAttrMatchExpr'
        - $ref: '#/components/parameters/hasCase'
        - $ref: '#/components/parameters/hasCaseOwner'
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    items:
                      $ref: '#/components/schemas/Task'
                    type: array
                type: object
          description: Success
      security:
        - oauth2:
            - taskrouter.task.unterminated:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: List Unterminated Tasks
      tags:
        - Tasks
  /companies/{companyId}/twilio-unterminated-tasks/{taskSid}:
    delete:
      description: >
        Delete the unterminated task from Twilio API (this proxy's Twilio's

        Task API).


        The deleted task immediately has its assignment status transition to
        `canceled`.

        This also generates the Twilio event `task.deleted`.


        An "unterminated" task is an "active" task—or any task which has yet to
        have its

        task assignment status set to `completed` or `canceled`. See:
        https://www.twilio.com/docs/taskrouter/lifecycle-task-state
      operationId: peach.twilio.taskrouter.handlers.delete_unterminated_task
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/taskSid'
      responses:
        '200':
          $ref: '#/components/responses/SingletonResponse'
      security:
        - oauth2:
            - taskrouter.task.unterminated:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Deletes Unterminated Task by SID
      tags:
        - Tasks
    get:
      description: >
        Read's the specified unterminated task from Twilio API (this proxy's
        Twilio's

        Task API).


        An "unterminated" task is an "active" task—or any task which has yet to
        have its

        task assignment status set to `completed` or `canceled`. See:
        https://www.twilio.com/docs/taskrouter/lifecycle-task-state
      operationId: peach.twilio.taskrouter.handlers.read_unterminated_task
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/taskSid'
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/Task'
                type: object
          description: Success
      security:
        - oauth2:
            - taskrouter.task.unterminated:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Read Unterminated Task by SID
      tags:
        - Tasks
  /companies/{companyId}/twilio-unterminated-tasks/{taskSid}/abandon:
    post:
      description: >
        Abandon an unterminated, accepted task. i.e., Mark the task as "Unable
        to Complete"

        and create a duplicate task.


        An "unterminated" task is an "active" task—or any task which has yet to
        have its

        task assignment status set to `completed` or `canceled`. See:
        https://www.twilio.com/docs/taskrouter/lifecycle-task-state
      operationId: peach.twilio.taskrouter.handlers.abandon_accepted_task
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/taskSid'
      responses:
        '200':
          description: Success
        '400':
          description: Failed to abandon task
      security:
        - oauth2:
            - taskrouter.task:receive
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Abandon Unterminated Task by SID
      tags:
        - Tasks
  /companies/{companyId}/twilio-workers:
    get:
      description: >
        List all Taskrouter Workers.


        Note that this endpoint returns *all* Twilio workers up to 10,000—i.e.,
        there

        is no paging. It may suffer from poor performance for large numbers of
        workers.
      operationId: peach.twilio.taskrouter.handlers_workers.list_workers
      parameters:
        - $ref: '#/components/parameters/companyId'
        - description: >
            Extra fields to include in the response.


            - `statsToday`: include the `statsToday` field with statistical
            information about the given workers
              since the start of "today" (from the worker's company's configured timezone).
          explode: false
          in: query
          name: include
          required: false
          schema:
            items:
              enum:
                - statsToday
              type: string
            type: array
          style: form
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: Success
      security:
        - oauth2:
            - employee:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: List Taskrouter Workers
      tags:
        - Tasks
  /companies/{companyId}/workflow-step-types:
    get:
      operationId: peach.workflows.handlers.get_workflow_step_types
      parameters:
        - $ref: '#/components/parameters/companyId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/NewPaginator'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/WorkflowStepType'
                        type: array
                    type: object
          description: OK
      security:
        - oauth2:
            - workflow.type:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get workflow step types
      tags:
        - Workflow Types
    post:
      operationId: peach.workflows.handlers.create_workflow_step_type
      parameters:
        - $ref: '#/components/parameters/companyId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowStepType'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/WorkflowStepType'
                    type: object
          description: OK
      security:
        - oauth2:
            - workflow.type:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create workflow step type
      tags:
        - Workflow Types
  /companies/{companyId}/workflow-step-types/{workflowStepTypeId}:
    delete:
      operationId: peach.workflows.handlers.delete_workflow_step_type
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/workflowStepTypeId'
      responses:
        '204':
          description: No content
      security:
        - oauth2:
            - workflow.type:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete workflow step type
      tags:
        - Workflow Types
    get:
      operationId: peach.workflows.handlers.get_workflow_step_type_by_id
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/workflowStepTypeId'
        - $ref: '#/components/parameters/expand'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/WorkflowStepType'
                    type: object
          description: OK
      security:
        - oauth2:
            - workflow.type:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get workflow step type
      tags:
        - Workflow Types
    put:
      operationId: peach.workflows.handlers.update_workflow_step_type
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/workflowStepTypeId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowStepType'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/WorkflowStepType'
                    type: object
          description: OK
      security:
        - oauth2:
            - workflow.type:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update workflow step type
      tags:
        - Workflow Types
  /companies/{companyId}/workflow-types:
    get:
      operationId: peach.workflows.handlers.get_workflow_types
      parameters:
        - $ref: '#/components/parameters/companyId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/NewPaginator'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/WorkflowType'
                        type: array
                    type: object
          description: OK
      security:
        - oauth2:
            - workflow.type:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get workflow types
      tags:
        - Workflow Types
    post:
      operationId: peach.workflows.handlers.create_workflow_type
      parameters:
        - $ref: '#/components/parameters/companyId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowType'
        description: The new workflow type
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/WorkflowType'
                    type: object
          description: OK
      security:
        - oauth2:
            - workflow.type:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create workflow type
      tags:
        - Workflow Types
  /companies/{companyId}/workflow-types/export:
    post:
      operationId: peach.workflows.handlers.export_workflow_types
      parameters:
        - $ref: '#/components/parameters/companyId'
        - description: The output format
          in: query
          name: format
          schema:
            default: json
            enum:
              - json
              - yaml
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  type: object
                type: array
            application/x-yaml:
              schema:
                type: string
          description: OK
      security:
        - oauth2:
            - workflow.type:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Export workflow, step and work item types.
      tags:
        - Workflow Types
  /companies/{companyId}/workflow-types/import:
    post:
      operationId: peach.workflows.handlers.import_workflow_types
      parameters:
        - $ref: '#/components/parameters/companyId'
      requestBody:
        content:
          application/json:
            schema:
              items:
                type: object
              type: array
          application/octet-stream:
            schema:
              description: '**DEPRECATED**: Use JSON or YAML format instead.'
              format: binary
              type: string
          application/x-yaml:
            schema:
              items:
                type: object
              type: array
        description: The data to import
        required: true
      responses:
        '204':
          description: success
      security:
        - oauth2:
            - workflow.type:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Restore previously exported workflow, step and work item types.
      tags:
        - Workflow Types
  /companies/{companyId}/workflow-types/{workflowTypeId}:
    delete:
      operationId: peach.workflows.handlers.delete_workflow_type
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/workflowTypeId'
      responses:
        '204':
          description: No content
      security:
        - oauth2:
            - workflow.type:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete workflow type
      tags:
        - Workflow Types
    get:
      operationId: peach.workflows.handlers.get_workflow_type_by_id
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/workflowTypeId'
        - $ref: '#/components/parameters/expand'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/WorkflowType'
                    type: object
          description: OK
      security:
        - oauth2:
            - workflow.type:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get workflow type by ID
      tags:
        - Workflow Types
    put:
      operationId: peach.workflows.handlers.update_workflow_type
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/workflowTypeId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowType'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/WorkflowType'
                    type: object
          description: OK
      security:
        - oauth2:
            - workflow.type:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update workflow type
      tags:
        - Workflow Types
  /companies/{companyId}/workflow-workitem-types:
    get:
      operationId: peach.workflows.handlers.get_workitem_types
      parameters:
        - $ref: '#/components/parameters/companyId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/NewPaginator'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/WorkflowWorkitemType'
                        type: array
                    type: object
          description: OK
      security:
        - oauth2:
            - workflow.type:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get work item types
      tags:
        - Workflow Types
    post:
      operationId: peach.workflows.handlers.create_workitem_type
      parameters:
        - $ref: '#/components/parameters/companyId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowWorkitemType'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/WorkflowWorkitemType'
                    type: object
          description: OK
      security:
        - oauth2:
            - workflow.type:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create work item type
      tags:
        - Workflow Types
  /companies/{companyId}/workflow-workitem-types/{workflowWorkitemTypeId}:
    delete:
      operationId: peach.workflows.handlers.delete_workitem_type
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/workflowWorkitemTypeId'
      responses:
        '204':
          description: No content
      security:
        - oauth2:
            - workflow.type:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete work item type
      tags:
        - Workflow Types
    get:
      operationId: peach.workflows.handlers.get_workitem_type_by_id
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/workflowWorkitemTypeId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/WorkflowWorkitemType'
                    type: object
          description: OK
      security:
        - oauth2:
            - workflow.type:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get work item type
      tags:
        - Workflow Types
    put:
      operationId: peach.workflows.handlers.update_workitem_type
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/workflowWorkitemTypeId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowWorkitemType'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/WorkflowWorkitemType'
                    type: object
          description: OK
      security:
        - oauth2:
            - workflow.type:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update work item type
      tags:
        - Workflow Types
  /compliance/auth/token:
    delete:
      operationId: peach.security.handlers.compliance_logout
      responses:
        '200':
          $ref: '#/components/responses/SingletonResponse'
      security:
        - oauth2: []
        - bearerAuth: []
      summary: End login session, invalidating current login token.
      tags:
        - Auth
    post:
      operationId: peach.security.handlers.compliance_validate_and_send_token
      parameters:
        - $ref: '#/components/parameters/companyIdQuery'
        - $ref: '#/components/parameters/domainQuery'
        - $ref: '#/components/parameters/userTypeQuery'
        - $ref: '#/components/parameters/authTypeQuery'
        - $ref: '#/components/parameters/authValueTypeQuery'
      requestBody:
        $ref: '#/components/requestBodies/AuthPost'
      responses:
        '200':
          $ref: '#/components/responses/JWT'
      security: []
      summary: Exchange username and password for JWT token
      tags:
        - Auth
    put:
      operationId: peach.security.handlers.compliance_renew_jwt_token
      responses:
        '200':
          $ref: '#/components/responses/JWT'
      security:
        - oauth2: []
        - bearerAuth: []
      summary: Exchange current token for a new one
      tags:
        - Auth
  /compliance/code:
    get:
      description: |
        Retrieve all available codes
      operationId: peach.compliance.handlers.code.code_get_all
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/derivedFromTypeId'
      responses:
        '200':
          $ref: '#/components/responses/CodeCollection'
      security:
        - oauth2:
            - compliance.code:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get codes
      tags:
        - Codes
  /compliance/code/{codeId}:
    post:
      operationId: peach.compliance.handlers.code.code_execute
      parameters:
        - $ref: '#/components/parameters/codeId'
        - $ref: '#/components/parameters/version'
      requestBody:
        $ref: '#/components/requestBodies/CodeExecution'
      responses:
        '200':
          $ref: '#/components/responses/CodeExecution'
      security:
        - oauth2:
            - compliance.code:execute
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Execute code
      tags:
        - Codes
    put:
      operationId: peach.compliance.handlers.code.code_update
      parameters:
        - $ref: '#/components/parameters/codeId'
        - $ref: '#/components/parameters/version'
      requestBody:
        $ref: '#/components/requestBodies/CodeUpdate'
      responses:
        '200':
          $ref: '#/components/responses/GetCode'
      security:
        - oauth2:
            - compliance.code:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update code
      tags:
        - Codes
  /do-not-interact-types:
    get:
      operationId: >-
        peach.cases.events.handlers.do_not_interact_type.do_not_interact_type_get_all
      parameters:
        - $ref: '#/components/parameters/loanTypeIdFilter'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
      responses:
        '200':
          $ref: '#/components/responses/DoNotInteractTypesPaging'
      security:
        - oauth2:
            - dni.type:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get types
      tags:
        - Do Not Interact Types
    post:
      operationId: >-
        peach.cases.events.handlers.do_not_interact_type.do_not_interact_type_create
      parameters:
        - $ref: '#/components/parameters/typeId'
        - $ref: '#/components/parameters/version'
      requestBody:
        $ref: '#/components/requestBodies/DoNotInteractType'
      responses:
        '200':
          $ref: '#/components/responses/DoNotInteractType'
      security:
        - oauth2:
            - dni.type:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create type
      tags:
        - Do Not Interact Types
  /do-not-interact-types/{doNotInteractTypeId}:
    get:
      operationId: >-
        peach.cases.events.handlers.do_not_interact_type.do_not_interact_type_get_by_id
      parameters:
        - $ref: '#/components/parameters/doNotInteractTypeId'
        - $ref: '#/components/parameters/version'
      responses:
        '200':
          $ref: '#/components/responses/DoNotInteractType'
      security:
        - oauth2:
            - dni.type:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get type by ID
      tags:
        - Do Not Interact Types
    put:
      description: >
        Change the triggering conditions and settings of a `draft` type, or
        update the `status` of an `active`

        type to `deprecated`. Doing the later will create a new `draft` version
        of the configuration unless

        explicitly told not to.
      operationId: >-
        peach.cases.events.handlers.do_not_interact_type.do_not_interact_type_update
      parameters:
        - $ref: '#/components/parameters/doNotInteractTypeId'
        - $ref: '#/components/parameters/version'
      requestBody:
        $ref: '#/components/requestBodies/DoNotInteractType'
      responses:
        '200':
          $ref: '#/components/responses/DoNotInteractType'
      security:
        - oauth2:
            - dni.type:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update type
      tags:
        - Do Not Interact Types
  /document-uploads/{documentUploadLinkKey}/documents:
    post:
      operationId: peach.docustore.handlers.documents_via_links.create_document_via_link
      parameters:
        - $ref: '#/components/parameters/documentUploadLinkKey'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentDescriptorCreate'
        description: The new document descriptor
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentDescriptorResponse'
          description: OK
      security: []
      summary: Create new document via link
      tags:
        - Documents
  /document-uploads/{documentUploadLinkKey}/documents/{documentDescriptorId}/content:
    post:
      operationId: >-
        peach.docustore.handlers.documents_via_links.upload_document_content_via_link
      parameters:
        - $ref: '#/components/parameters/documentUploadLinkKey'
        - $ref: '#/components/parameters/documentDescriptorId'
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
                file:
                  format: binary
                  type: string
              required:
                - file
              type: object
        description: The document content
        required: true
      responses:
        '201':
          description: Created
      security: []
      summary: Upload document content via link
      tags:
        - Documents
  /employees:
    get:
      description: |
        Get employees
      operationId: peach.employees.handlers.employees.employees_get
      parameters:
        - $ref: '#/components/parameters/sortBy'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/queryTeamId'
        - $ref: '#/components/parameters/queryTeamIds'
        - $ref: '#/components/parameters/queryExcludeTeamIds'
        - $ref: '#/components/parameters/queryManagerEmployeeId'
        - $ref: '#/components/parameters/queryEmployeeSearch'
      responses:
        '200':
          $ref: '#/components/responses/EmployeesPaging'
      security:
        - oauth2:
            - employee:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get employees
      tags:
        - Employees
    post:
      description: |
        Create a new employee for a company.
      operationId: peach.employees.handlers.employees.employee_create
      requestBody:
        $ref: '#/components/requestBodies/EmployeePost'
      responses:
        '200':
          $ref: '#/components/responses/Employee'
      security:
        - oauth2:
            - employee:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create employee
      tags:
        - Employees
  /employees/{employeeId}:
    get:
      description: |
        Get employee by ID
      operationId: peach.employees.handlers.employees.employee_get_by_id
      parameters:
        - $ref: '#/components/parameters/employeeId'
      responses:
        '200':
          $ref: '#/components/responses/Employee'
      security:
        - oauth2:
            - employee:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get employee by ID
      tags:
        - Employees
    put:
      description: |
        Update an employee
      operationId: peach.employees.handlers.employees.employee_update
      parameters:
        - $ref: '#/components/parameters/employeeId'
      requestBody:
        $ref: '#/components/requestBodies/EmployeePut'
      responses:
        '200':
          $ref: '#/components/responses/Employee'
      security:
        - oauth2:
            - employee:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update employee
      tags:
        - Employees
  /employees/{employeeId}/email-signature:
    get:
      description: |
        Get the employee's email signature
      operationId: peach.employees.handlers.email_signature.employee_email_signature_get
      parameters:
        - $ref: '#/components/parameters/employeeId'
      responses:
        '200':
          $ref: '#/components/responses/EmailSignature'
      security:
        - oauth2:
            - employee.emailsignature:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get email signature
      tags:
        - Employees
    put:
      description: |
        Update the employee's email signature
      operationId: peach.employees.handlers.email_signature.employee_email_signature_set
      parameters:
        - $ref: '#/components/parameters/employeeId'
      requestBody:
        $ref: '#/components/requestBodies/EmailSignaturePut'
      responses:
        '200':
          $ref: '#/components/responses/EmailSignature'
      security:
        - oauth2:
            - employee.emailsignature:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update email signature
      tags:
        - Employees
  /employees/{employeeId}/teams/{teamId}:
    delete:
      description: |
        Remove an employee from a team
      operationId: peach.employees.handlers.employees.employee_remove_from_team
      parameters:
        - $ref: '#/components/parameters/employeeId'
        - $ref: '#/components/parameters/teamId'
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - employee:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Remove employee from team
      tags:
        - Employees
    put:
      description: |
        Add employee to a team
      operationId: peach.employees.handlers.employees.employee_add_to_team
      parameters:
        - $ref: '#/components/parameters/employeeId'
        - $ref: '#/components/parameters/teamId'
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - employee:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Add employee to team
      tags:
        - Employees
  /events:
    get:
      operationId: peach.events.handlers.get_events_external
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/sortBy'
        - $ref: '#/components/parameters/personFilter'
        - $ref: '#/components/parameters/periodIdQuery'
        - $ref: '#/components/parameters/loanFilter'
        - $ref: '#/components/parameters/caseFilter'
        - $ref: '#/components/parameters/transactionFilter'
        - $ref: '#/components/parameters/createdAtFrom'
        - $ref: '#/components/parameters/createdAtTo'
        - $ref: '#/components/parameters/effectiveAtFrom'
        - $ref: '#/components/parameters/effectiveAtTo'
        - $ref: '#/components/parameters/accrualDate'
        - $ref: '#/components/parameters/includeDeleted'
        - $ref: '#/components/parameters/includeEventTypes'
        - $ref: '#/components/parameters/excludeEventTypes'
        - $ref: '#/components/parameters/webhookId'
        - $ref: '#/components/parameters/parameters-supercaseId'
        - $ref: '#/components/parameters/skipTotalCount'
        - description: A comma separated list of creatingMessageIds to return.
          in: query
          name: creatingMessageIds
          schema:
            items:
              type: string
            type: array
      responses:
        '200':
          $ref: '#/components/responses/EventsPublic'
      security:
        - oauth2:
            - event:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Retrieve events
      tags:
        - Events
  /interactions:
    get:
      operationId: peach.people.interaction.handlers.unbound_interaction_get_all
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/hasNoPerson'
        - $ref: '#/components/parameters/channel'
        - $ref: '#/components/parameters/direction'
        - $ref: '#/components/parameters/status'
        - $ref: '#/components/parameters/statusDetails'
        - $ref: '#/components/parameters/agentOutcome'
        - $ref: '#/components/parameters/parameters-subject'
        - $ref: '#/components/parameters/theme'
        - $ref: '#/components/parameters/caseIds'
        - $ref: '#/components/parameters/contentContains'
        - $ref: '#/components/parameters/sortBy'
        - $ref: '#/components/parameters/createdAtBefore'
        - $ref: '#/components/parameters/createdAtAfter'
        - $ref: '#/components/parameters/startedAtBefore'
        - $ref: '#/components/parameters/startedAtAfter'
        - $ref: '#/components/parameters/scheduledAtFromBefore'
        - $ref: '#/components/parameters/scheduledAtFromAfter'
        - $ref: '#/components/parameters/scheduledAtToBefore'
        - $ref: '#/components/parameters/scheduledAtToAfter'
        - $ref: '#/components/parameters/createdBy'
        - $ref: '#/components/parameters/hasVoicemail'
        - $ref: '#/components/parameters/hasRecording'
        - $ref: '#/components/parameters/parameters-includeFields'
        - $ref: '#/components/parameters/sensitive'
        - $ref: '#/components/parameters/isExternal'
      responses:
        '200':
          $ref: '#/components/responses/InteractionsPaging'
      security:
        - oauth2:
            - interaction:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get interactions
      tags:
        - Interactions
  /interactions/{interactionId}:
    get:
      operationId: peach.people.interaction.handlers.unbound_interaction_get_by_id
      parameters:
        - $ref: '#/components/parameters/interactionId'
        - $ref: '#/components/parameters/searchable'
      responses:
        '200':
          $ref: '#/components/responses/Interaction'
      security:
        - oauth2:
            - interaction:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get interaction by ID
      tags:
        - Interactions
  /interactions/{interactionId}/call-transcripts/summaries:
    get:
      operationId: >-
        peach.ai.call_transcription.handlers.unbound_interaction_call_summary_results_get_by_interaction
      parameters:
        - $ref: '#/components/parameters/interactionId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/callTranscriptionResultStatus'
        - $ref: '#/components/parameters/aICallTranscriptionResultIdFilter'
      responses:
        '200':
          $ref: '#/components/responses/CallSummaryResultsPaging'
      security:
        - oauth2:
            - interaction:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get interaction call summaries
      tags:
        - Interactions
  /interactions/{interactionId}/convo:
    get:
      operationId: peach.twilio.convo.handlers_api.interaction_convo_get
      parameters:
        - $ref: '#/components/parameters/interactionId'
      responses:
        '200':
          description: Success
      security:
        - oauth2:
            - conversation:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get interaction convo
      tags:
        - Interactions
  /interactions/{interactionId}/convo/close:
    post:
      operationId: peach.twilio.convo.handlers_api.interaction_convo_close
      parameters:
        - $ref: '#/components/parameters/interactionId'
      responses:
        '200':
          description: Success
      security:
        - oauth2:
            - conversation:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Close interaction convo
      tags:
        - Interactions
  /interactions/{interactionId}/convo/join:
    post:
      description: >
        Add the user making the request to the conversation associated with this
        interaction.


        Note that only users of type `Agent` can join conversations. (i.e.,
        `Service` and `Borrower`

        users cannot join conversations.)
      operationId: peach.twilio.convo.handlers_api.interaction_convo_join
      parameters:
        - $ref: '#/components/parameters/interactionId'
      requestBody:
        $ref: '#/components/requestBodies/ConvoJoin'
      responses:
        '200':
          description: Success
      security:
        - oauth2:
            - conversation:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Join interaction convo
      tags:
        - Interactions
  /interactions/{interactionId}/convo/leave:
    post:
      operationId: peach.twilio.convo.handlers_api.interaction_convo_leave
      parameters:
        - $ref: '#/components/parameters/interactionId'
      responses:
        '200':
          description: Success
      security:
        - oauth2:
            - conversation:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Leave interaction convo
      tags:
        - Interactions
  /interactions/{interactionId}/notes:
    get:
      operationId: peach.notes.handlers.list_interaction_notes
      parameters:
        - $ref: '#/components/parameters/interactionId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/noteCategories'
        - $ref: '#/components/parameters/sortBy'
        - description: Include archived notes into the result
          in: query
          name: includeArchived
          required: false
          schema:
            default: false
            type: boolean
        - $ref: '#/components/parameters/notePinned'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/NewPaginator'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/NoteResponse'
                        type: array
                    type: object
          description: OK
      security:
        - oauth2:
            - note:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get notes
      tags:
        - Notes
    post:
      operationId: peach.notes.handlers.create_interaction_note
      parameters:
        - $ref: '#/components/parameters/interactionId'
      requestBody:
        $ref: '#/components/requestBodies/Note'
      responses:
        '200':
          $ref: '#/components/responses/Note'
      security:
        - oauth2:
            - note:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create note
      tags:
        - Notes
  /interactions/{interactionId}/notes/{noteId}:
    get:
      operationId: peach.notes.handlers.get_interaction_note
      parameters:
        - $ref: '#/components/parameters/interactionId'
        - description: The note identifier.
          in: path
          name: noteId
          required: true
          schema:
            type: string
      responses:
        '200':
          $ref: '#/components/responses/Note'
      security:
        - oauth2:
            - note:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get note by ID
      tags:
        - Notes
    put:
      operationId: peach.notes.handlers.update_interaction_note
      parameters:
        - $ref: '#/components/parameters/interactionId'
        - description: The note identifier.
          in: path
          name: noteId
          required: true
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/Note'
      responses:
        '200':
          $ref: '#/components/responses/Note'
      security:
        - oauth2:
            - note:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update note
      tags:
        - Notes
  /interactions/{interactionId}/previous:
    get:
      description: |
        For this interaction, get all the previous interactions linked to it
        via the `previousInteractionId` field.
      operationId: peach.people.interaction.handlers.unbound_get_many_previous_interactions
      parameters:
        - $ref: '#/components/parameters/interactionId'
        - $ref: '#/components/parameters/parameters-includeFields'
      responses:
        '200':
          $ref: '#/components/responses/InteractionsManyNoPaging'
      security:
        - oauth2:
            - interaction:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get previous interactions
      tags:
        - Interactions
  /interactions/{interactionId}/recording-content:
    get:
      operationId: peach.people.interaction.handlers.unbound_interaction_download_recording
      parameters:
        - $ref: '#/components/parameters/interactionId'
        - $ref: '#/components/parameters/disposition'
        - $ref: '#/components/parameters/returnUrl'
      responses:
        '200':
          $ref: '#/components/responses/200ReturnUrl'
        '302':
          $ref: '#/components/responses/302DownloadRecordedContents'
      security:
        - oauth2:
            - interaction:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Download interaction recording
      tags:
        - Interactions
  /interactions/{interactionId}/voicemail-content:
    get:
      operationId: peach.people.interaction.handlers.unbound_interaction_download_voicemail
      parameters:
        - $ref: '#/components/parameters/interactionId'
        - $ref: '#/components/parameters/disposition'
        - $ref: '#/components/parameters/returnUrl'
      responses:
        '200':
          $ref: '#/components/responses/200ReturnUrl'
        '302':
          $ref: '#/components/responses/302DownloadRecordedContents'
      security:
        - oauth2:
            - interaction:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Download interaction voicemail
      tags:
        - Interactions
  /keys:
    get:
      operationId: peach.security.api_keys.handlers.company_api_keys_get_all
      parameters:
        - $ref: '#/components/parameters/APIKeyStatus'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/NewPaginator'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/ResponseAPIKeyNoSecret'
                        type: array
                    type: object
          description: Success
      security:
        - oauth2:
            - company.keys:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get all API keys
      tags:
        - API Keys
    post:
      operationId: peach.security.api_keys.handlers.company_api_key_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyAPIKeyNoSecret'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseAPIKeyNoSecret'
          description: Created
      security:
        - oauth2:
            - company.keys:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create an API key
      tags:
        - API Keys
  /keys/{keyId}:
    delete:
      operationId: peach.security.api_keys.handlers.company_api_key_delete
      parameters:
        - $ref: '#/components/parameters/APIKeyId'
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - company.keys:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete an API key
      tags:
        - API Keys
    get:
      operationId: peach.security.api_keys.handlers.company_api_key_get
      parameters:
        - $ref: '#/components/parameters/APIKeyId'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseAPIKeyNoSecret'
          description: Success
      security:
        - oauth2:
            - company.keys:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get an API key
      tags:
        - API Keys
    put:
      operationId: peach.security.api_keys.handlers.company_api_key_update
      parameters:
        - $ref: '#/components/parameters/APIKeyId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestBodyAPIKeyUpdateAPIVersioning'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseAPIKeyNoSecretAPIVersioning'
          description: Success
      security:
        - oauth2:
            - company.keys:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update an API key
      tags:
        - API Keys
  /loan-types/{loanTypeId}/fee-types:
    get:
      operationId: peach.people.loans.fees.handlers.fee_types_get
      parameters:
        - $ref: '#/components/parameters/loanTypeId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        items:
                          properties:
                            apiName:
                              $ref: '#/components/schemas/FeeApiName'
                            displayName:
                              $ref: '#/components/schemas/FeeDisplayName'
                          type: object
                        type: array
                    type: object
          description: Success
      security:
        - oauth2:
            - loan:types.list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get fee types
      tags:
        - Fees
  /loan-types/{loanTypeId}/index-rates:
    get:
      operationId: peach.loan_configuration.handlers.loan_type_index_rate_get_all
      parameters:
        - $ref: '#/components/parameters/loanTypeId'
        - description: >
            The from date of the index rate. Pass the same value in the
            `fromDate` and `toDate` if you need to get the index rate for a

            specific date.
          in: query
          name: fromDate
          schema:
            format: date
            type: string
        - description: >
            The end date of the index rate. Pass the same value in the
            `fromDate` and `toDate` if you need to get the index rate for a

            specific date. If only a `fromDate` is specified, we assume no end
            date for the filter.
          in: query
          name: toDate
          schema:
            format: date
            type: string
      responses:
        '200':
          $ref: '#/components/responses/IndexRatePaging'
      security:
        - oauth2:
            - indexrates:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get index interest rates
      tags:
        - Index Rates
    post:
      operationId: peach.loan_configuration.handlers.loan_type_index_rate_add
      parameters:
        - $ref: '#/components/parameters/loanTypeId'
      requestBody:
        $ref: '#/components/requestBodies/IndexRateAdd'
      responses:
        '200':
          $ref: '#/components/responses/IndexRateResponse'
      security:
        - oauth2:
            - indexrates:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Add index interest rate
      tags:
        - Index Rates
  /loan-types/{loanTypeId}/index-rates/{indexRateId}:
    delete:
      operationId: peach.loan_configuration.handlers.loan_type_index_rate_delete
      parameters:
        - $ref: '#/components/parameters/loanTypeId'
        - $ref: '#/components/parameters/indexRateId'
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - indexrates:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Cancel index interest rate
      tags:
        - Index Rates
    get:
      operationId: peach.loan_configuration.handlers.loan_type_index_rate_get
      parameters:
        - $ref: '#/components/parameters/loanTypeId'
        - $ref: '#/components/parameters/indexRateId'
      responses:
        '200':
          $ref: '#/components/responses/IndexRateResponse'
      security:
        - oauth2:
            - indexrates:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get index interest rate by ID
      tags:
        - Index Rates
    put:
      description: |
        This endpoint is used for updating index interest rates.
      operationId: peach.loan_configuration.handlers.loan_type_index_rate_update
      parameters:
        - $ref: '#/components/parameters/loanTypeId'
        - $ref: '#/components/parameters/indexRateId'
      requestBody:
        $ref: '#/components/requestBodies/IndexRateUpdate'
      responses:
        '200':
          $ref: '#/components/responses/IndexRateResponse'
      security:
        - oauth2:
            - indexrates:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update index interest rate
      tags:
        - Index Rates
  /loans:
    get:
      description: |
        Get all loans associated with a company.
      operationId: peach.loans.handlers.loans_get_by_company
      parameters:
        - $ref: '#/components/parameters/fieldsGetLoans'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/loanStatuses'
        - $ref: '#/components/parameters/managedByPeach'
        - $ref: '#/components/parameters/includeAdditionalBorrowers'
        - $ref: '#/components/parameters/loanTypeIdFilter'
        - $ref: '#/components/parameters/loanLabels'
        - $ref: '#/components/parameters/createdAtBefore'
        - $ref: '#/components/parameters/createdAtAfter'
        - $ref: '#/components/parameters/updatedAtBefore'
        - $ref: '#/components/parameters/updatedAtAfter'
        - $ref: '#/components/parameters/originatedAtAfter'
        - $ref: '#/components/parameters/originatedAtBefore'
        - $ref: '#/components/parameters/activatedAtBefore'
        - $ref: '#/components/parameters/activatedAtAfter'
        - $ref: '#/components/parameters/sortByForLoans'
        - $ref: '#/components/parameters/loansDueDate'
      responses:
        '200':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/LoansPaging'
                  - $ref: '#/components/schemas/LoansMinimalPaging'
          description: Success
        '404':
          description: Not found
      security:
        - oauth2:
            - loan:listall
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loans
      tags:
        - Loans
  /notification-types:
    get:
      operationId: peach.cases.events.handlers.notifications.notification_type_get_all
      parameters:
        - $ref: '#/components/parameters/loanTypeIdFilter'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
      responses:
        '200':
          $ref: '#/components/responses/NotificationTypesPaging'
      security:
        - oauth2:
            - notification.type:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get types
      tags:
        - Notification Types
    post:
      description: |
        Create a new type configuration for triggering notifications.
      operationId: peach.cases.events.handlers.notifications.notification_type_create
      parameters:
        - $ref: '#/components/parameters/typeId'
        - $ref: '#/components/parameters/version'
      requestBody:
        $ref: '#/components/requestBodies/NotificationType'
      responses:
        '200':
          $ref: '#/components/responses/NotificationType'
      security:
        - oauth2:
            - notification.type:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create type
      tags:
        - Notification Types
  /notification-types/{notificationTypeId}:
    get:
      operationId: peach.cases.events.handlers.notifications.notification_type_get_by_id
      parameters:
        - $ref: '#/components/parameters/notificationTypeId'
        - $ref: '#/components/parameters/version'
      responses:
        '200':
          $ref: '#/components/responses/NotificationType'
      security:
        - oauth2:
            - notification.type:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get type by ID
      tags:
        - Notification Types
    put:
      description: >
        Change the triggering conditions and settings of a `draft` type, or
        update the `status` of an `active`

        type to `deprecated`.
      operationId: peach.cases.events.handlers.notifications.notification_type_update
      parameters:
        - $ref: '#/components/parameters/notificationTypeId'
        - $ref: '#/components/parameters/version'
      requestBody:
        $ref: '#/components/requestBodies/NotificationType'
      responses:
        '200':
          $ref: '#/components/responses/NotificationType'
      security:
        - oauth2:
            - notification.type:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update type
      tags:
        - Notification Types
  /operations/{operationId}:
    get:
      operationId: peach.operation_status.handlers.operation_status_get
      parameters:
        - $ref: '#/components/parameters/operationId'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SingletonResponse'
          description: Success
        '206':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SingletonResponse'
          description: In progress
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SingletonResponse'
          description: Not found
        '412':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SingletonResponse'
          description: Operation failed
      security:
        - oauth2: []
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get operation status
      tags:
        - Operations
  /payment-processors:
    get:
      operationId: peach.payment_processors.handlers.get_payment_processors
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/sortBy'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/PaymentProcessor'
                        type: array
                    type: object
          description: Success
      security:
        - oauth2:
            - payment.processor:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get payment processors
      tags:
        - Payment Processors
    post:
      operationId: peach.payment_processors.handlers.create_payment_processor
      parameters:
        - $ref: '#/components/parameters/skipConnectionTest'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentProcessorCreateRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/PaymentProcessor'
                    type: object
          description: Created
      security:
        - oauth2:
            - payment.processor:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create payment processor
      tags:
        - Payment Processors
  /payment-processors/{paymentProcessorId}:
    delete:
      operationId: peach.payment_processors.handlers.delete_payment_processor
      parameters:
        - $ref: '#/components/parameters/paymentProcessorId'
      responses:
        '204':
          description: Deleted
      security:
        - oauth2:
            - payment.processor:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete payment processor
      tags:
        - Payment Processors
    get:
      operationId: peach.payment_processors.handlers.get_one_payment_processor
      parameters:
        - $ref: '#/components/parameters/paymentProcessorId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/PaymentProcessor'
                    type: object
          description: Success
      security:
        - oauth2:
            - payment.processor:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get payment processor
      tags:
        - Payment Processors
    put:
      operationId: peach.payment_processors.handlers.update_payment_processor
      parameters:
        - $ref: '#/components/parameters/paymentProcessorId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentProcessorUpdateRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/PaymentProcessor'
                    type: object
          description: Updated
      security:
        - oauth2:
            - payment.processor:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update payment processor
      tags:
        - Payment Processors
  /people:
    get:
      description: |
        Get borrowers filtering with optional parameters.
      operationId: peach.people.handlers.borrowers_list
      parameters:
        - $ref: '#/components/parameters/searchable'
        - $ref: '#/components/parameters/borrowerStatus'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/sortBy'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/borrowerType'
        - $ref: '#/components/parameters/queryIds'
      responses:
        '200':
          $ref: '#/components/responses/PersonPaging'
      security:
        - oauth2:
            - person:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get borrowers
      tags:
        - Borrowers
    post:
      description: |
        Create a new borrower.
      operationId: peach.people.handlers.borrower_create
      requestBody:
        $ref: '#/components/requestBodies/PersonRequest'
      responses:
        '200':
          $ref: '#/components/responses/Person'
      security:
        - oauth2:
            - person:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create borrower
      tags:
        - Borrowers
  /people/search:
    get:
      description: >
        Search for borrowers. Returns same resources

        as <a
        href="/api-docs/api-public/borrowers/peach.people.handlers.borrowers_list">/people</a>.
      operationId: peach.people.handlers.borrower_search
      parameters:
        - $ref: '#/components/parameters/_hasTheWords'
        - $ref: '#/components/parameters/_notTheWords'
        - $ref: '#/components/parameters/address'
        - $ref: '#/components/parameters/bankruptcyCourtCase'
        - $ref: '#/components/parameters/borrowerType'
        - $ref: '#/components/parameters/businessName'
        - $ref: '#/components/parameters/components-parameters-caseId'
        - $ref: '#/components/parameters/city'
        - $ref: '#/components/parameters/dateOfBirth'
        - $ref: '#/components/parameters/email'
        - $ref: '#/components/parameters/emailExact'
        - $ref: '#/components/parameters/employeeEmail'
        - $ref: '#/components/parameters/employeeEmailExact'
        - $ref: '#/components/parameters/employeePhone'
        - $ref: '#/components/parameters/employeeName'
        - $ref: '#/components/parameters/firstName'
        - $ref: '#/components/parameters/firstNamePartial'
        - $ref: '#/components/parameters/fullName'
        - $ref: '#/components/parameters/incorporatedState'
        - $ref: '#/components/parameters/id'
        - $ref: '#/components/parameters/components-parameters-interactionId'
        - $ref: '#/components/parameters/lastName'
        - $ref: '#/components/parameters/lastNamePartial'
        - $ref: '#/components/parameters/legalRepFirstName'
        - $ref: '#/components/parameters/legalRepLastName'
        - $ref: '#/components/parameters/legalRepEmail'
        - $ref: '#/components/parameters/legalRepPhone'
        - $ref: '#/components/parameters/parameters-loanId'
        - $ref: '#/components/parameters/loanIdPartial'
        - $ref: '#/components/parameters/maidenName'
        - $ref: '#/components/parameters/maidenNamePartial'
        - $ref: '#/components/parameters/middleName'
        - $ref: '#/components/parameters/middleNamePartial'
        - $ref: '#/components/parameters/paymentMethod'
        - $ref: '#/components/parameters/phone'
        - $ref: '#/components/parameters/postalCode'
        - $ref: '#/components/parameters/state'
        - $ref: '#/components/parameters/taxId'
        - $ref: '#/components/parameters/_forceIndex'
      responses:
        '200':
          $ref: '#/components/responses/PersonSearchPaging'
      security:
        - oauth2:
            - person:search
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Search borrowers
      tags:
        - Borrowers
  /people/{personId}:
    get:
      description: |
        Get an existing borrower by ID.
      operationId: peach.people.handlers.borrower_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/includeIdentity'
      responses:
        '200':
          $ref: '#/components/responses/Person'
      security:
        - oauth2:
            - person:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get borrower by ID
      tags:
        - Borrowers
    put:
      description: Update an existing borrower.
      operationId: peach.people.handlers.borrower_update
      parameters:
        - $ref: '#/components/parameters/personId'
      requestBody:
        $ref: '#/components/requestBodies/PersonPutRequest'
      responses:
        '200':
          $ref: '#/components/responses/PersonNoIdentity'
      security:
        - oauth2:
            - person:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update borrower
      tags:
        - Borrowers
  /people/{personId}/can-interact:
    post:
      description: >
        Returns whether or not a communication is allowed with a borrower.


        It uses past interactions, current borrower status, loan status,

        and relevant Compliance Guard rules to make a decision if it is

        permissable to communicate with a borrower.


        Note this endpoint always returns a 200 status code if we could
        successfully

        calculate a result. (i.e., even if a communication is not permitted

        this is a `200` response.)
      operationId: peach.people.handlers.can_interact
      parameters:
        - $ref: '#/components/parameters/personId'
      requestBody:
        $ref: '#/components/requestBodies/CanInteract'
      responses:
        '200':
          $ref: '#/components/responses/CanInteract'
      security:
        - oauth2:
            - interaction:check
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Can interact
      tags:
        - Compliance Guard
  /people/{personId}/cases:
    get:
      description: |
        Get all cases associated with a borrower.
      operationId: peach.cases.handlers.list_cases_by_borrower
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/sortBy'
        - $ref: '#/components/parameters/expand'
        - $ref: '#/components/parameters/includeFields'
        - $ref: '#/components/parameters/associations'
        - $ref: '#/components/parameters/caseOutcome'
        - $ref: '#/components/parameters/caseStatus'
        - $ref: '#/components/parameters/caseStatuses'
        - $ref: '#/components/parameters/caseStatusUpdatedBefore'
        - $ref: '#/components/parameters/caseStatusUpdatedAfter'
        - $ref: '#/components/parameters/caseNumber'
        - $ref: '#/components/parameters/caseType'
        - $ref: '#/components/parameters/createdBefore'
        - $ref: '#/components/parameters/createdAfter'
        - $ref: '#/components/parameters/nupUpdatedNull'
        - $ref: '#/components/parameters/snoozedUntilBefore'
        - $ref: '#/components/parameters/snoozedUntilAfter'
        - $ref: '#/components/parameters/owningEmployeeId'
        - $ref: '#/components/parameters/loanTypes'
        - $ref: '#/components/parameters/filterInteractionStatus'
        - $ref: '#/components/parameters/filterInteractionChannel'
        - $ref: '#/components/parameters/filterInteractionScheduledAtFromBefore'
        - $ref: '#/components/parameters/filterInteractionScheduledAtFromAfter'
        - $ref: '#/components/parameters/filterInteractionScheduledAtToBefore'
        - $ref: '#/components/parameters/filterInteractionScheduledAtToAfter'
        - $ref: '#/components/parameters/associatedDocumentId'
      responses:
        '200':
          $ref: '#/components/responses/CasesPaging'
      security:
        - oauth2:
            - case:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get borrower cases
      tags:
        - Cases
    post:
      description: |
        Create a new case and associate it with a borrower using their ID.
      operationId: peach.cases.handlers.create_case
      parameters:
        - $ref: '#/components/parameters/personId'
      requestBody:
        $ref: '#/components/requestBodies/CasePost'
      responses:
        '200':
          $ref: '#/components/responses/Case'
      security:
        - oauth2:
            - case:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create borrower case
      tags:
        - Cases
  /people/{personId}/cases/{caseId}:
    delete:
      description: >
        Remove association of an existing `case`, `interaction`, `loan`, or
        `file` objects from the case.
      operationId: peach.cases.handlers.remove_case_association
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseId'
        - $ref: '#/components/parameters/removeObjectType'
        - $ref: '#/components/parameters/removeObjectId'
        - $ref: '#/components/parameters/relation'
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - case.association:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Remove association
      tags:
        - Cases
    get:
      operationId: peach.cases.handlers.get_case_by_id
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseId'
        - $ref: '#/components/parameters/associations'
        - $ref: '#/components/parameters/includeFields'
      responses:
        '200':
          $ref: '#/components/responses/Case'
      security:
        - oauth2:
            - case:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get borrower case by ID
      tags:
        - Cases
    post:
      description: >
        Associate an existing `case`, `interaction`, `loan`, or `file` objects
        to the case.

        This way you can create comprehensive view of the case.
      operationId: peach.cases.handlers.add_case_association
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseId'
      requestBody:
        $ref: '#/components/requestBodies/AssociationPost'
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - case.association:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Add association
      tags:
        - Cases
    put:
      description: |
        Update a case associated with a borrower.
      operationId: peach.cases.handlers.update_case
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseId'
      requestBody:
        $ref: '#/components/requestBodies/CasePut'
      responses:
        '200':
          $ref: '#/components/responses/Case'
      security:
        - oauth2:
            - case:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update case
      tags:
        - Cases
  /people/{personId}/cases/{caseId}/do-not-interacts:
    get:
      description: |
        Get the all `DoNoInteract` instances associated with a case.
      operationId: peach.cases.events.handlers.do_not_interact.do_not_interact_get_all
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/sortBy'
      responses:
        '200':
          $ref: '#/components/responses/DoNotInteractPaging'
      security:
        - oauth2:
            - dni:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get case do not interacts
      tags:
        - Do Not Interact
    post:
      operationId: peach.cases.events.handlers.do_not_interact.do_not_interact_create
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseId'
      requestBody:
        $ref: '#/components/requestBodies/DoNotInteractCreate'
      responses:
        '200':
          $ref: '#/components/responses/DoNotInteract'
      security:
        - oauth2:
            - dni:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create do not interact
      tags:
        - Do Not Interact
  /people/{personId}/cases/{caseId}/do-not-interacts/{doNotInteractId}:
    delete:
      description: >
        Update a `DoNotInteract` instance to have `inactive` status, and set the
        end date.
      operationId: peach.cases.events.handlers.do_not_interact.do_not_interact_delete
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseId'
        - $ref: '#/components/parameters/doNotInteractId'
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - dni:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Remove do not interact
      tags:
        - Do Not Interact
    get:
      description: >
        Get a single `DoNotInteract` object instance for the borrower using a
        unique ID.
      operationId: peach.cases.events.handlers.do_not_interact.do_not_interact_get_by_id
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseId'
        - $ref: '#/components/parameters/doNotInteractId'
      responses:
        '200':
          $ref: '#/components/responses/DoNotInteract'
      security:
        - oauth2:
            - dni:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get do not interact by ID
      tags:
        - Do Not Interact
    put:
      description: |
        Update a `DoNotInteract` instance with new information.
      operationId: peach.cases.events.handlers.do_not_interact.do_not_interact_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseId'
        - $ref: '#/components/parameters/doNotInteractId'
      requestBody:
        $ref: '#/components/requestBodies/DoNotInteractUpdate'
      responses:
        '200':
          $ref: '#/components/responses/DoNotInteract'
      security:
        - oauth2:
            - dni:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update do not interact
      tags:
        - Do Not Interact
  /people/{personId}/cases/{caseId}/escalations:
    get:
      description: |
        List case escalations
      operationId: peach.cases.escalations.handlers.case_escalations_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseId'
      responses:
        '200':
          $ref: '#/components/responses/CaseEscalationPaging'
      security:
        - oauth2:
            - case:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: List case escalations
      tags:
        - Cases
    post:
      description: |
        Escalate or de-escalate a case
      operationId: peach.cases.escalations.handlers.case_escalations_create
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseId'
      requestBody:
        $ref: '#/components/requestBodies/CaseEscalationPost'
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - case:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Escalate or de-escalate a case
      tags:
        - Cases
  /people/{personId}/cases/{caseId}/escalations/{caseEscalationId}:
    get:
      description: |
        List case escalations
      operationId: peach.cases.escalations.handlers.case_escalation_get_by_id
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseId'
        - $ref: '#/components/parameters/caseEscalationId'
      responses:
        '200':
          $ref: '#/components/responses/CaseEscalationDetailed'
      security:
        - oauth2:
            - case:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: List case escalation by ID
      tags:
        - Cases
  /people/{personId}/cases/{caseId}/notes:
    get:
      operationId: peach.notes.handlers.list_case_notes
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/noteCategories'
        - $ref: '#/components/parameters/sortBy'
        - description: Include archived notes into the result
          in: query
          name: includeArchived
          required: false
          schema:
            default: false
            type: boolean
        - $ref: '#/components/parameters/notePinned'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/NewPaginator'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/NoteResponse'
                        type: array
                    type: object
          description: OK
      security:
        - oauth2:
            - note:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get notes
      tags:
        - Notes
    post:
      operationId: peach.notes.handlers.create_case_note
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseId'
      requestBody:
        $ref: '#/components/requestBodies/Note'
      responses:
        '200':
          $ref: '#/components/responses/Note'
      security:
        - oauth2:
            - note:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create note
      tags:
        - Notes
  /people/{personId}/cases/{caseId}/notes/{noteId}:
    get:
      operationId: peach.notes.handlers.get_case_note
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseId'
        - description: The note identifier.
          in: path
          name: noteId
          required: true
          schema:
            type: string
      responses:
        '200':
          $ref: '#/components/responses/Note'
      security:
        - oauth2:
            - note:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get note by ID
      tags:
        - Notes
    put:
      operationId: peach.notes.handlers.update_case_note
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseId'
        - description: The note identifier.
          in: path
          name: noteId
          required: true
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/Note'
      responses:
        '200':
          $ref: '#/components/responses/Note'
      security:
        - oauth2:
            - note:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update note
      tags:
        - Notes
  /people/{personId}/cases/{caseId}/snooze:
    post:
      description: |
        Snooze the case or cancel the case snooze.
      operationId: peach.cases.handlers.snooze_case
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseId'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                snoozeFor:
                  description: >
                    The number of days to snooze for. To cancel snoozing set to
                    `null`.

                    If the current time has caught up to the `snoozedUntil` date
                    then setting

                    this `snoozeFor` to `null` also causes the snooze to "pop"
                    which initiates

                    a case review task into the task system.
                  minimum: 1
                  nullable: true
                  type: integer
              required:
                - snoozeFor
              type: object
        required: true
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - case:snooze
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Snooze case
      tags:
        - Cases
  /people/{personId}/cases/{caseId}/views:
    post:
      description: |
        Mark a case as viewed by the current user
      operationId: peach.cases.handlers.view_case
      parameters:
        - $ref: '#/components/parameters/caseId'
        - $ref: '#/components/parameters/personId'
      responses:
        '204':
          description: Successfully marked case as viewed
      security:
        - oauth2:
            - case:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Mark a case as viewed
      tags:
        - Cases
  /people/{personId}/consents:
    get:
      description: |
        Get all consent associated with a borrower.
      operationId: peach.people.handlers.consent_get
      parameters:
        - $ref: '#/components/parameters/personId'
      responses:
        '200':
          $ref: '#/components/responses/Consent'
      security:
        - oauth2:
            - consent:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get consents
      tags:
        - Consent
    put:
      description: |
        Update the consents
      operationId: peach.people.handlers.consent_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/caseIdQuery'
      requestBody:
        $ref: '#/components/requestBodies/UpdateConsent'
      responses:
        '200':
          $ref: '#/components/responses/Consent'
      security:
        - oauth2:
            - consent:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update consents
      tags:
        - Consent
  /people/{personId}/contacts:
    get:
      description: |
        List contacts for a borrower.
      operationId: peach.people.contact.handlers.list_contacts_for_borrower
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/sortBy'
        - $ref: '#/components/parameters/contactCollidesWithEmail'
        - $ref: '#/components/parameters/contactCollidesWithPhone'
        - $ref: '#/components/parameters/contactType'
        - $ref: '#/components/parameters/contactAffiliation'
        - $ref: '#/components/parameters/contactLabel'
        - $ref: '#/components/parameters/contactStatus'
        - $ref: '#/components/parameters/contactIncludeArchived'
        - $ref: '#/components/parameters/contactIncludeLegal'
        - $ref: '#/components/parameters/receiveTextMessages'
        - $ref: '#/components/parameters/contactValue'
        - $ref: '#/components/parameters/powerOfAttorney'
        - $ref: '#/components/parameters/authorizedThirdParty'
      responses:
        '200':
          $ref: '#/components/responses/ContactInformationPaging'
      security:
        - oauth2:
            - contact:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: List contact for borrower
      tags:
        - Contact Information
    post:
      description: |
        Create contact for a borrower.
      operationId: peach.people.contact.handlers.create_contact_for_borrower
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/contactValidate'
        - $ref: '#/components/parameters/confirmationCode'
      requestBody:
        $ref: '#/components/requestBodies/ContactBody'
      responses:
        '200':
          $ref: '#/components/responses/ContactInformation'
      security:
        - oauth2:
            - contact:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create contact
      tags:
        - Contact Information
  /people/{personId}/contacts/{contactId}:
    delete:
      description: |
        Delete a borrower's contact.
      operationId: peach.people.contact.handlers.delete_contact
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/contactId'
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - contact:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete contact
      tags:
        - Contact Information
    get:
      operationId: peach.people.contact.handlers.get_contact_for_borrower
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/contactId'
      responses:
        '200':
          $ref: '#/components/responses/ContactInformation'
      security:
        - oauth2:
            - contact:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get contact by ID
      tags:
        - Contact Information
    put:
      description: |
        Update contact of a borrower.
      operationId: peach.people.contact.handlers.update_contact_for_borrower
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/contactId'
        - $ref: '#/components/parameters/confirmationCode'
        - $ref: '#/components/parameters/contactValidate'
      requestBody:
        $ref: '#/components/requestBodies/ContactBody'
      responses:
        '200':
          $ref: '#/components/responses/ContactInformation'
      security:
        - oauth2:
            - contact:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update contact
      tags:
        - Contact Information
  /people/{personId}/contacts/{contactId}/clone:
    post:
      description: >
        Clones the borrower's contact information. 


        This copies all properties from the existing contact and applies 

        the passed properties. Sets `externalId` of the existing contact to
        `null`. 

        Sets the `status` of the existing contact to `archived`.


        Returns the new contact with a new Peach ID.
      operationId: peach.people.contact.handlers.clone_contact
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/contactId'
        - $ref: '#/components/parameters/confirmationCode'
        - $ref: '#/components/parameters/contactValidate'
      requestBody:
        $ref: '#/components/requestBodies/ContactBody'
      responses:
        '200':
          $ref: '#/components/responses/ContactInformation'
      security:
        - oauth2:
            - contact:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Clone contact
      tags:
        - Contact Information
  /people/{personId}/do-not-interacts:
    get:
      description: |
        Get the all `DoNoInteract` instances associated with a borrower.
      operationId: peach.people.do_not_interact.handlers.do_not_interact_get_all
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/sortBy'
      responses:
        '200':
          $ref: '#/components/responses/DoNotInteractPaging'
      security:
        - oauth2:
            - dni:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get all do not interacts
      tags:
        - Do Not Interact
  /people/{personId}/document-upload-links:
    get:
      operationId: peach.docustore.handlers.document_upload_links.get_document_upload_links
      parameters:
        - $ref: '#/components/parameters/personId'
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/DocumentUploadLink'
                type: array
          description: OK
      security:
        - oauth2:
            - document-upload-link:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get document upload links
      tags:
        - Documents
    post:
      operationId: >-
        peach.docustore.handlers.document_upload_links.create_document_upload_link
      parameters:
        - $ref: '#/components/parameters/personId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentUploadLink'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentUploadLink'
          description: OK
      security:
        - oauth2:
            - document-upload-link:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create document upload link
      tags:
        - Documents
  /people/{personId}/document-upload-links/{documentUploadLinkId}:
    get:
      operationId: peach.docustore.handlers.document_upload_links.get_document_upload_link
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/documentUploadLinkId'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentUploadLink'
          description: OK
      security:
        - oauth2:
            - document-upload-link:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get doc upload link by ID
      tags:
        - Documents
  /people/{personId}/documents:
    get:
      operationId: peach.docustore.handlers.list_person_documents
      parameters:
        - $ref: '#/components/parameters/personId'
        - description: The document type to select by.
          in: query
          name: type
          required: false
          schema:
            items:
              $ref: '#/components/schemas/DocumentType'
            type: array
        - description: The loan identifier to select by.
          in: query
          name: loanId
          required: false
          schema:
            type: string
        - description: Include archived documents into the result
          in: query
          name: includeArchived
          required: false
          schema:
            default: false
            type: boolean
        - description: >-
            Show documents that were uploaded by a specific user. Use `borrower`
            to show documents uploaded only by the borrower.
          in: query
          name: uploadedBy
          required: false
          schema:
            type: string
        - description: >
            If `true` only include documents which are `autogenerated == true`,
            and likewise for

            `false`.
          in: query
          name: autogenerated
          required: false
          schema:
            type: boolean
        - description: >
            If `true` only include documents which are `isHumanBorrowerUpload ==
            true`, and likewise for

            `false`.
          in: query
          name: isHumanBorrowerUpload
          required: false
          schema:
            type: boolean
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/DocumentDescriptorResponse'
                type: array
          description: OK
      security:
        - oauth2:
            - document:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get document descriptors
      tags:
        - Documents
    post:
      operationId: peach.docustore.handlers.create_person_document
      parameters:
        - $ref: '#/components/parameters/personId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentDescriptorCreate'
        description: The new document descriptor
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentDescriptorResponse'
          description: OK
        '400':
          content:
            text/plain:
              schema:
                type: string
          description: Bad request
      security:
        - oauth2:
            - document:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create new document descriptor
      tags:
        - Documents
  /people/{personId}/documents/{documentDescriptorId}:
    delete:
      operationId: peach.docustore.handlers.delete_document
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/documentDescriptorId'
      responses:
        '200':
          description: OK
        '404':
          content:
            text/plain:
              schema:
                type: string
          description: Not Found
      security:
        - oauth2:
            - document:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete document
      tags:
        - Documents
    get:
      operationId: peach.docustore.handlers.get_person_document
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/documentDescriptorId'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentDescriptorResponse'
          description: OK
      security:
        - oauth2:
            - document:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get document descriptor by ID
      tags:
        - Documents
    put:
      operationId: peach.docustore.handlers.update_person_document
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/documentDescriptorId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentDescriptorUpdate'
        description: Document descriptor fields
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentDescriptorResponse'
          description: OK
        '400':
          content:
            text/plain:
              schema:
                type: string
          description: Bad request
      security:
        - oauth2:
            - document:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update document descriptor
      tags:
        - Documents
  /people/{personId}/documents/{documentDescriptorId}/content:
    get:
      operationId: peach.docustore.handlers.download_person_document_content
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/documentDescriptorId'
        - description: The response content disposition to set.
          in: query
          name: disposition
          schema:
            enum:
              - inline
              - attachment
            type: string
        - description: Access token used to gain temporary access to the document.
          in: query
          name: token
          schema:
            type: string
        - description: >-
            If `true`, will return a URL to the content instead of redirecting
            to the content.
          in: query
          name: returnUrl
          required: false
          schema:
            default: false
            type: boolean
      responses:
        '200':
          content:
            application/pdf:
              schema:
                format: binary
                type: string
            text/html:
              schema:
                type: string
          description: The document content
      security:
        - oauth2:
            - document:read
        - bearerAuth: []
        - apiKeyHeader: []
        - bearerAuthQuery: []
      summary: Download document content
      tags:
        - Documents
    post:
      operationId: peach.docustore.handlers.upload_person_document_content
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/documentDescriptorId'
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
                file:
                  format: binary
                  type: string
              type: object
        description: The document content
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentDescriptorResponse'
          description: OK
        '400':
          content:
            text/plain:
              schema:
                type: string
          description: Bad request
      security:
        - oauth2:
            - document:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Upload document content
      tags:
        - Documents
  /people/{personId}/documents/{documentDescriptorId}/convert:
    post:
      operationId: peach.docustore.handlers.convert_person_document
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/documentDescriptorId'
        - description: The document output format.
          in: query
          name: format
          required: true
          schema:
            enum:
              - pdf
            type: string
        - description: Sign after conversion.
          in: query
          name: sign
          schema:
            type: boolean
        - $ref: '#/components/parameters/DeleteSource'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentDescriptorResponse'
          description: OK
        '400':
          content:
            text/plain:
              schema:
                type: string
          description: Bad request
      security:
        - oauth2:
            - document:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Convert document to the specified format
      tags:
        - Documents
  /people/{personId}/documents/{documentDescriptorId}/sign:
    post:
      operationId: peach.docustore.handlers.sign_person_pdf_document
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/documentDescriptorId'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentDescriptorResponse'
          description: OK
        '400':
          content:
            text/plain:
              schema:
                type: string
          description: Bad request
        '500':
          content:
            text/plain:
              schema:
                type: string
          description: Server misconfiguration or error
      security:
        - oauth2:
            - document:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Digitally sign document
      tags:
        - Documents
  /people/{personId}/identities:
    get:
      operationId: peach.people.handlers.list_identities
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/includeArchivedIdentities'
      responses:
        '200':
          $ref: '#/components/responses/IdentityPaging'
      security:
        - oauth2:
            - person.identity:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get identities
      tags:
        - Identity
    post:
      operationId: peach.people.handlers.create_identity
      parameters:
        - $ref: '#/components/parameters/personId'
      requestBody:
        $ref: '#/components/requestBodies/IdentityRequest'
      responses:
        '200':
          $ref: '#/components/responses/Identity'
      security:
        - oauth2:
            - person.identity:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create identity
      tags:
        - Identity
  /people/{personId}/identities/{personIdentityId}:
    delete:
      description: Primary identities cannot be archived.
      operationId: peach.people.handlers.delete_identity
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/personIdentityId'
        - $ref: '#/components/parameters/caseIdQuery'
      responses:
        '204':
          description: No content
      security:
        - oauth2:
            - person.identity:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Archive identity
      tags:
        - Identity
    get:
      operationId: peach.people.handlers.get_identity
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/personIdentityId'
      responses:
        '200':
          $ref: '#/components/responses/Identity'
      security:
        - oauth2:
            - person.identity:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get identity by ID
      tags:
        - Identity
    put:
      description: |
        For primary identities, the `isArchived` field cannot be changed.
      operationId: peach.people.handlers.update_identity
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/personIdentityId'
      requestBody:
        $ref: '#/components/requestBodies/IdentityPutRequest'
      responses:
        '200':
          $ref: '#/components/responses/Identity'
      security:
        - oauth2:
            - person.identity:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update identity
      tags:
        - Identity
  /people/{personId}/identity:
    get:
      operationId: peach.people.handlers.get_primary_identity
      parameters:
        - $ref: '#/components/parameters/personId'
      responses:
        '200':
          $ref: '#/components/responses/Identity'
      security:
        - oauth2:
            - person.identity:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get primary identity
      tags:
        - Identity
  /people/{personId}/interaction-notes:
    get:
      operationId: peach.notes.handlers.list_borrower_interaction_notes
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/sortBy'
        - description: Include archived notes into the result
          in: query
          name: includeArchived
          required: false
          schema:
            default: false
            type: boolean
        - $ref: '#/components/parameters/notePinned'
        - description: Only include notes for the interactions with the specified channels.
          in: query
          name: channels
          required: false
          schema:
            items:
              $ref: '#/components/schemas/InteractionChannel'
            type: array
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/NewPaginator'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/NoteResponse'
                        type: array
                    type: object
          description: OK
      security:
        - oauth2:
            - note:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get interaction notes for a person
      tags:
        - Notes
  /people/{personId}/interactions:
    get:
      operationId: peach.people.interaction.handlers.interaction_get_all
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/channel'
        - $ref: '#/components/parameters/direction'
        - $ref: '#/components/parameters/status'
        - $ref: '#/components/parameters/statusDetails'
        - $ref: '#/components/parameters/agentOutcome'
        - $ref: '#/components/parameters/parameters-subject'
        - $ref: '#/components/parameters/theme'
        - $ref: '#/components/parameters/caseIds'
        - $ref: '#/components/parameters/contentContains'
        - $ref: '#/components/parameters/interactionsSortBy'
        - $ref: '#/components/parameters/parameters-includeFields'
        - $ref: '#/components/parameters/createdAtBefore'
        - $ref: '#/components/parameters/createdAtAfter'
        - $ref: '#/components/parameters/startedAtBefore'
        - $ref: '#/components/parameters/startedAtAfter'
        - $ref: '#/components/parameters/scheduledAtFromBefore'
        - $ref: '#/components/parameters/scheduledAtFromAfter'
        - $ref: '#/components/parameters/scheduledAtToBefore'
        - $ref: '#/components/parameters/scheduledAtToAfter'
        - $ref: '#/components/parameters/createdBy'
        - $ref: '#/components/parameters/hasVoicemail'
        - $ref: '#/components/parameters/hasRecording'
        - $ref: '#/components/parameters/sensitive'
        - $ref: '#/components/parameters/isExternal'
      responses:
        '200':
          $ref: '#/components/responses/InteractionsPaging'
      security:
        - oauth2:
            - interaction:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get borrower interactions
      tags:
        - Interactions
    post:
      description: >
        Creating interactions tracks the history of communication between
        lenders/servicers and borrowers.


        Note that this does NOT send a message—merely tracks that it occurred.
        If you need to send a message, use the

        `/communicator/send` endpoint.
      operationId: peach.people.interaction.handlers.interaction_add
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/searchable'
      requestBody:
        $ref: '#/components/requestBodies/InteractionPost'
      responses:
        '200':
          $ref: '#/components/responses/Interaction'
      security:
        - oauth2:
            - interaction:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create interaction
      tags:
        - Interactions
  /people/{personId}/interactions/{interactionId}:
    delete:
      description: |
        Delete an interaction. Only external interactions (interactions created
        by lenders via API) can be deleted.
      operationId: peach.people.interaction.handlers.interaction_delete
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/interactionId'
      responses:
        '200':
          description: Success
      security:
        - oauth2:
            - interaction:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete interaction
      tags:
        - Interactions
    get:
      operationId: peach.people.interaction.handlers.interaction_get_by_id
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/interactionId'
        - $ref: '#/components/parameters/searchable'
      responses:
        '200':
          $ref: '#/components/responses/Interaction'
      security:
        - oauth2:
            - interaction:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get interaction by ID
      tags:
        - Interactions
    put:
      operationId: peach.people.interaction.handlers.interaction_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/interactionId'
      requestBody:
        $ref: '#/components/requestBodies/InteractionPut'
      responses:
        '200':
          $ref: '#/components/responses/Interaction'
      security:
        - oauth2:
            - interaction:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update interaction
      tags:
        - Interactions
  /people/{personId}/interactions/{interactionId}/call-transcripts/summaries:
    get:
      operationId: >-
        peach.ai.call_transcription.handlers.call_summary_results_get_by_interaction
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/interactionId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/callTranscriptionResultStatus'
        - $ref: '#/components/parameters/aICallTranscriptionResultIdFilter'
      responses:
        '200':
          $ref: '#/components/responses/CallSummaryResultsPaging'
      security:
        - oauth2:
            - interaction:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get interaction call summaries
      tags:
        - Interactions
  /people/{personId}/interactions/{interactionId}/cases:
    get:
      operationId: peach.people.interaction.handlers.get_interaction_cases
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/interactionId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          $ref: '#/components/responses/CasesPaging'
      security:
        - oauth2:
            - case:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get cases associated with an interaction
      tags:
        - Interactions
  /people/{personId}/interactions/{interactionId}/previous:
    get:
      description: |
        For this interaction, get all the previous interactions linked to it
        via the `previousInteractionId` field.
      operationId: peach.people.interaction.handlers.get_many_previous_interactions
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/interactionId'
        - $ref: '#/components/parameters/parameters-includeFields'
      responses:
        '200':
          $ref: '#/components/responses/InteractionsManyNoPaging'
      security:
        - oauth2:
            - interaction:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get previous interactions
      tags:
        - Interactions
  /people/{personId}/interactions/{interactionId}/recording-content:
    get:
      operationId: peach.people.interaction.handlers.interaction_download_recording
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/interactionId'
        - $ref: '#/components/parameters/disposition'
        - $ref: '#/components/parameters/returnUrl'
      responses:
        '200':
          $ref: '#/components/responses/200ReturnUrl'
        '302':
          $ref: '#/components/responses/302DownloadRecordedContents'
      security:
        - oauth2:
            - interaction:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Download interaction recording
      tags:
        - Interactions
  /people/{personId}/interactions/{interactionId}/voicemail-content:
    get:
      operationId: peach.people.interaction.handlers.interaction_download_voicemail
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/interactionId'
        - $ref: '#/components/parameters/disposition'
        - $ref: '#/components/parameters/returnUrl'
      responses:
        '200':
          $ref: '#/components/responses/200ReturnUrl'
        '302':
          $ref: '#/components/responses/302DownloadRecordedContents'
      security:
        - oauth2:
            - interaction:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Download interaction voicemail
      tags:
        - Interactions
  /people/{personId}/legal-representatives:
    get:
      operationId: peach.people.legal.handlers.legal_representative_get_all
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - description: Include archived representatives into the result.
          in: query
          name: includeArchived
          schema:
            default: false
            type: boolean
      responses:
        '200':
          $ref: '#/components/responses/LegalRepresentativesPaging'
      security:
        - oauth2:
            - legal.representative:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get representatives
      tags:
        - Legal Representation
    post:
      operationId: peach.people.legal.handlers.legal_representative_add
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/contactValidate'
      requestBody:
        $ref: '#/components/requestBodies/LegalRepresentative'
      responses:
        '200':
          $ref: '#/components/responses/LegalRepresentative'
      security:
        - oauth2:
            - legal.representative:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create representative
      tags:
        - Legal Representation
  /people/{personId}/legal-representatives/{legalRepresentativeId}:
    get:
      operationId: peach.people.legal.handlers.legal_representative_get_by_id
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/legalRepresentativeId'
      responses:
        '200':
          $ref: '#/components/responses/LegalRepresentative'
      security:
        - oauth2:
            - legal.representative:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get representative by ID
      tags:
        - Legal Representation
    put:
      operationId: peach.people.legal.handlers.legal_representative_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/legalRepresentativeId'
        - $ref: '#/components/parameters/contactValidate'
      requestBody:
        $ref: '#/components/requestBodies/LegalRepresentative'
      responses:
        '200':
          $ref: '#/components/responses/LegalRepresentative'
      security:
        - oauth2:
            - legal.representative:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update representative
      tags:
        - Legal Representation
  /people/{personId}/loans:
    get:
      operationId: peach.people.loans.handlers.loans_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/filterLoanStatus'
        - $ref: '#/components/parameters/loanTypeIdFilter'
        - $ref: '#/components/parameters/includeAdditionalBorrowers'
        - $ref: '#/components/parameters/chargeOffBalance'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoansPaging'
          description: Success
        '404':
          description: Not found
      security:
        - oauth2:
            - loan:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get borrower's loans
      tags:
        - Loans
    post:
      description: Add a new loan.
      operationId: peach.people.loans.handlers.loans_add
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/contactValidate'
      requestBody:
        $ref: '#/components/requestBodies/LoanPost'
      responses:
        '200':
          $ref: '#/components/responses/Loan'
      security:
        - oauth2:
            - loan:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create loan
      tags:
        - Loans
  /people/{personId}/loans/{loanId}:
    get:
      operationId: peach.people.loans.handlers.loan_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/includeAdditionalBorrowers'
      responses:
        '200':
          $ref: '#/components/responses/Loan'
      security:
        - oauth2:
            - loan:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan by ID
      tags:
        - Loans
    put:
      operationId: peach.people.loans.handlers.loan_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/contactValidate'
        - $ref: '#/components/parameters/forceLoanUpdate'
      requestBody:
        $ref: '#/components/requestBodies/LoanUpdate'
      responses:
        '200':
          $ref: '#/components/responses/Loan'
      security:
        - oauth2:
            - loan:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update loan
      tags:
        - Loans
  /people/{personId}/loans/{loanId}/accelerate:
    post:
      description: >
        The accelerate endpoint will change the status of an `active` loan to
        `accelerated`,

        and trigger any acceleration-related logic and accounting treatment.


        Acceleration is only valid for installment and line of credit loans.
      operationId: peach.people.loans.handlers.loan_accelerate
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/LoanAccelerate'
      responses:
        '200':
          $ref: '#/components/responses/LoanAccelerate'
      security:
        - oauth2:
            - loan:accelerate
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Accelerate loan
      tags:
        - Loans
  /people/{personId}/loans/{loanId}/activate:
    post:
      operationId: peach.people.loans.handlers.loan_activate
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/syncGeneric'
      requestBody:
        $ref: '#/components/requestBodies/LoanActivate'
      responses:
        '200':
          $ref: '#/components/responses/LoanActivate'
        '408':
          description: Request Timeout
      security:
        - oauth2:
            - loan:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Activate loan
      tags:
        - Loans
  /people/{personId}/loans/{loanId}/advances:
    get:
      description: Returns an installment loan's advances
      operationId: peach.people.loans.installment_advances.handlers.get_loan_advances
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/advanceStatus'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        properties:
                          advances:
                            items:
                              $ref: '#/components/schemas/Advance'
                            type: array
                          totalAdvancedAmount:
                            description: >
                              The total of advances amounts in `pending` or
                              `settled` status. In other words, the total of
                              advances that

                              were written to the ledger.
                            format: float
                            type: number
                          totalScheduledAmount:
                            description: >-
                              The total of advances amounts in `scheduled`
                              status.
                            format: float
                            type: number
                        type: object
                    type: object
          description: Success
      security:
        - oauth2:
            - loan.advance:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get advances
      tags:
        - Installment Advances
    post:
      operationId: peach.people.loans.installment_advances.handlers.create_loan_advance
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/syncGeneric'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - required:
                    - status
                    - amount
                    - advanceDate
                  title: Advance
                  type: object
                - $ref: '#/components/schemas/Advance'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/Advance'
                    type: object
          description: Created
        '408':
          description: Request Timeout
      security:
        - oauth2:
            - loan.advance:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create advance
      tags:
        - Installment Advances
  /people/{personId}/loans/{loanId}/advances/{advanceId}:
    get:
      description: Returns an installment loan advance
      operationId: peach.people.loans.installment_advances.handlers.get_loan_advance
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/advanceId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/Advance'
                    type: object
          description: Success
      security:
        - oauth2:
            - loan.advance:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get advance by ID
      tags:
        - Installment Advances
    put:
      operationId: peach.people.loans.installment_advances.handlers.update_loan_advance
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/advanceId'
        - $ref: '#/components/parameters/syncGeneric'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Advance'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/Advance'
                    type: object
          description: Updated
        '408':
          description: Request Timeout
      security:
        - oauth2:
            - loan.advance:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update advance
      tags:
        - Installment Advances
  /people/{personId}/loans/{loanId}/amortize-preview:
    post:
      description: >
        This endpoint is used for previewing draw amortization. The draw must
        have non-due principal to be amortized.


        Note:

        - If the loan type is configured to accrue interest as
        `accrualMethod=compoundWithFees`, there is a

        known limitation to the draw amortization calculation logic.

        - The draw amortization calculation will be done using the `compound`
        method and not `compoundWithFees`.

        To ensure that the system calculates interest accurately, amortized
        draws should NOT include any fees.
      operationId: peach.people.loans.draws.handlers.preview_draw_amortize
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                drawFee:
                  description: The draw fee.
                  format: float
                  type: number
                duration:
                  description: >
                    The new duration of the draw as a number of
                    `paymentFrequency` of the line of credit.


                    If this endpoint is called when the draw has already been
                    active for some number of periods, the `duration` parameter

                    will generate `duration` _additional_ periods from the time
                    at which the endpoint is called. For example, if a draw has

                    duration 10, and it is amortized again in period 5 with
                    `duration=10`, the result will be a draw with a total
                    duration of 15.


                    The caller needs to pass one of the values only, `duration`
                    or `recurringPaymentAmount`.
                  format: int32
                  type: integer
                purchaseAmount:
                  description: The total amount of the purchases for preview.
                  format: float
                  type: number
                recurringAmount:
                  description: >
                    The recurring payment amount. The system will calculate the
                    needed duration. Pass one of the values only,

                    `duration` or `recurringPaymentAmount`.
                  format: float
                  type: number
                serviceFeeAmount:
                  description: >
                    The service fee amount that will be charged recurrently.
                    Only required if the service fee `chargeLogic` is
                    `[loanPeriod, everyOtherLoanPeriod, calendarPeriod]` and

                    `amountLogic` is configured as `type=passedAtOrigination`.
                    In all other cases, the system will calculate the fee based
                    on pre-configured logic.
                  format: float
                  type: number
                serviceFeeCapAmount:
                  description: >
                    The maximum amount of the service fee that can be charged
                    over the life of the loan or draw. Only required if the
                    service fee `chargeLogic` is

                    `[loanPeriod, everyOtherLoanPeriod, calendarPeriod]` and
                    `capLogic` is configured as `type=capPassedAtOrigination`.
                    In all other cases, the system will calculate

                    the fee based on pre-configured logic.
                  format: float
                  type: number
                startDate:
                  description: >-
                    The start date of the draw. The system will assume today if
                    not specified.
                  format: date
                  type: string
              required:
                - purchaseAmount
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/LoanSchedule'
                    type: object
          description: Success
        '408':
          description: Request Timeout
      security:
        - oauth2:
            - draw:amortize
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Preview draw amortization
      tags:
        - Line of Credit Draws
  /people/{personId}/loans/{loanId}/autopay:
    delete:
      operationId: peach.people.loans.autopay.handlers.loan_autopay_delete
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/autopayCancellationReason'
        - description: The case object unique identifier.
          in: query
          name: caseId
          required: false
          schema:
            $ref: '#/components/schemas/AnyId'
        - description: >
            When set to `false`, the system will NOT send a
            `autopayCanceledBySystem` notice to the borrower.
          in: query
          name: sendNotice
          required: false
          schema:
            default: true
            type: boolean
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - autopay:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Cancel Autopay plan
      tags:
        - Autopay
    get:
      operationId: peach.people.loans.autopay.handlers.loan_autopay_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/autopayExpectedPaymentStatus'
      responses:
        '200':
          $ref: '#/components/responses/Autopay'
      security:
        - oauth2:
            - autopay:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get Autopay plan
      tags:
        - Autopay
    post:
      operationId: peach.people.loans.autopay.handlers.loan_autopay_post
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/AutopayPost'
      responses:
        '200':
          $ref: '#/components/responses/AutopayPost'
      security:
        - oauth2:
            - autopay:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create Autopay plan
      tags:
        - Autopay
    put:
      operationId: peach.people.loans.autopay.handlers.loan_autopay_put
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/AutopayPut'
      responses:
        '200':
          $ref: '#/components/responses/AutopayPut'
      security:
        - oauth2:
            - autopay:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update Autopay plan
      tags:
        - Autopay
  /people/{personId}/loans/{loanId}/balances:
    get:
      operationId: peach.people.loans.balances.handlers.loan_balances_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/isRounded'
        - $ref: '#/components/parameters/skipYtd'
        - $ref: '#/components/parameters/fast'
        - $ref: '#/components/parameters/toEffectiveDate'
      responses:
        '200':
          $ref: '#/components/responses/Balances'
      security:
        - oauth2:
            - loan:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan balances
      tags:
        - Balances
  /people/{personId}/loans/{loanId}/cancel:
    post:
      description: >
        The cancel loan endpoint will change the status of a loan to `canceled`,
        and

        trigger any cancellation-related logic, such as removing a loan from
        active monitoring

        and handling the accounting treatment for canceled loans.


        An installment loan must be in `originated` or `pending` status to be
        canceled.


        A line of credit loan can be canceled if it has no draws with active
        purchases.


        Special permission is required to cancel `active` loans.


        The metro2 details may optionally be sent with the `accountStatusCode`
        to indicate

        what should be reported to credit agencies.
      operationId: peach.people.loans.handlers.loan_cancel
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/forceLoanCancel'
        - $ref: '#/components/parameters/clearAllExternalIdsLoanCancel'
        - $ref: '#/components/parameters/syncLoanCancel'
      requestBody:
        $ref: '#/components/requestBodies/LoanCancel'
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '408':
          description: Request Timeout
      security:
        - oauth2:
            - loan:cancel
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Cancel loan
      tags:
        - Loans
  /people/{personId}/loans/{loanId}/cancel-fees:
    post:
      operationId: peach.people.loans.fees.handlers.fees_cancel
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/clearExternalIdGeneric'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                caseId:
                  description: An identifier for an existing case.
                  type: string
                loanFeeIds:
                  items:
                    description: The identifier of the loan fee
                    type: string
                  type: array
              type: object
        required: true
      responses:
        '204':
          description: Canceled
        '423':
          $ref: '#/components/responses/LockedResponse'
      security:
        - oauth2:
            - loan:cancel.dynamicfee
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Cancel dynamic fees
      tags:
        - Fees
  /people/{personId}/loans/{loanId}/cards:
    get:
      operationId: peach.card_issuers.handlers.cards_list
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/showPan'
        - $ref: '#/components/parameters/showCvv'
        - $ref: '#/components/parameters/refresh'
        - $ref: '#/components/parameters/cardStatusFilter'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/sortBy'
      responses:
        '200':
          $ref: '#/components/responses/CardPagingResponse'
      security:
        - oauth2:
            - card:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get cards
      tags:
        - Cards
    post:
      description: >
        The card details.


        You can pass either `issuerId` + corresponding `accountIdentifier` for
        the card (e.g. `accountIdentifiers.galileoCad`) attributes or the
        `cardDetails` object.


        If `issuerId` + card `accountIdentifier` attributes are passed and
        `issuerEventsSubscriber` is set to `peach`, Peach will sync the card
        status, transactions and balances with the loan ledger seamlessly. Note:
        these attributes must be passed if `issuerEventsSubscriber` is set to
        `peach`, because Peach will need the identifying information to tie the
        issuer's events to the proper card.


        If `cardDetails` is passed, the card details will be stored in the Peach
        system as read-only. The lender is responsible for updating the loan
        details based on the card usage. Note: if `cardDetails` is passed
        without `issuerId` and `accountIdentifier`, `issuerEventsSubscriber`
        cannot be set to `peach`.


        The card `issuerId` and `accountIdentifier` attributes can be updated
        only if the loan status is originated or pending. After the loan is
        activated, the `issuerId` and `accountIdentifier` information cannot be
        changed.
      operationId: peach.card_issuers.handlers.card_create
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/CardPost'
      responses:
        '200':
          $ref: '#/components/responses/CardResponse'
      security:
        - oauth2:
            - card:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create card
      tags:
        - Cards
  /people/{personId}/loans/{loanId}/cards/{cardId}:
    get:
      operationId: peach.card_issuers.handlers.card_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/cardId'
        - $ref: '#/components/parameters/showPan'
        - $ref: '#/components/parameters/showCvv'
        - $ref: '#/components/parameters/refresh'
      responses:
        '200':
          $ref: '#/components/responses/CardResponseWithPanAndCvv'
      security:
        - oauth2:
            - card:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get card
      tags:
        - Cards
    put:
      description: >
        The card details.


        You can pass either `issuerId` + corresponding `accountIdentifier` for
        the card (e.g. `accountIdentifiers.galileoCad`) attributes or the
        `cardDetails` object.


        If `issuerId` + card `accountIdentifier` attributes are passed and
        `issuerEventsSubscriber` is set to `peach`, Peach will sync the card
        status, transactions and balances with the loan ledger seamlessly. Note:
        these attributes must be passed if `issuerEventsSubscriber` is set to
        `peach`, because Peach will need the identifying information to tie the
        issuer's events to the proper card.


        If `cardDetails` is passed, the card details will be stored in the Peach
        system as read-only. The lender is responsible for updating the loan
        details based on the card usage. Note: if `cardDetails` is passed
        without `issuerId` and `accountIdentifier`, `issuerEventsSubscriber`
        cannot be set to `peach`.


        The card `issuerId` and `accountIdentifier` attributes can be updated
        only if the loan status is originated or pending. After the loan is
        activated, the `issuerId` and `accountIdentifier` information cannot be
        changed.
      operationId: peach.card_issuers.handlers.card_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/cardId'
      requestBody:
        $ref: '#/components/requestBodies/CardPut'
      responses:
        '200':
          $ref: '#/components/responses/CardResponse'
      security:
        - oauth2:
            - card:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update card
      tags:
        - Cards
  /people/{personId}/loans/{loanId}/charge-off:
    post:
      description: >
        The charge-off endpoint will change the status of a loan to
        `chargedOff`, and trigger any

        charge-off-related logic and accounting treatment.


        A loan must be in `accelerated` status before being moved to
        `chargedOff`. If an active loan

        is being charged off, this endpoint will handle moving the loan status
        to acceleration

        before charging off. Charge-off is only valid for installment and line
        of credit loans.
      operationId: peach.people.loans.handlers.loan_charge_off
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/LoanChargeOff'
      responses:
        '200':
          $ref: '#/components/responses/LoanChargeOff'
      security:
        - oauth2:
            - loan:chargeoff
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Charge-off loan
      tags:
        - Loans
  /people/{personId}/loans/{loanId}/close:
    post:
      description: >
        Closing a loan
          - For line of credit - Prevents new draws from being opened and closes existing draws to block new purchases.
          - For installment loan with multiple advances - Prevents new advances from being created and cancels existing scheduled advances.
          - Stops further credit extension while maintaining existing balances and payment obligations.

        After closing a line of credit, the loan and all its draws will
        automatically transition to `paidOff` status

        once all of the following conditions are met:
          - The line and all its draws have no outstanding balance.
          - There are no pending transactions on the line or any of its draws.
          - There are no pending, authorized, or blocking disputed purchases on the line or any draw.
          - There are no open bankruptcy cases associated with the line.

        A line of credit or any of its draws in `paidOff` status cannot be
        reopened.
      operationId: peach.people.loans.handlers.loan_close
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                caseId:
                  description: An identifier for an existing case.
                  type: string
                closeReason:
                  $ref: '#/components/schemas/CloseReason'
                closeReasonDetails:
                  $ref: '#/components/schemas/CloseReasonDetails'
                closeRequestedByBorrower:
                  $ref: '#/components/schemas/CloseRequestedByBorrower'
                sendNotice:
                  $ref: '#/components/schemas/LoanCloseSendNotice'
              type: object
        required: true
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - loan:close
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Close loan
      tags:
        - Loans
  /people/{personId}/loans/{loanId}/collection-agency:
    delete:
      description: >
        This endpoint is used to "unassign" a loan from a collection agency. To
        keep the `servicedBy` value on the loan to `debtCollectionAgency`,

        just pass that value to this endpoint and the `servicedBy` will remain
        the same, while still clearing the collection agency assignment fields
        for the loan.
      operationId: peach.collections.handlers.collection_agency_loan_details_unassign
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/servicedBy'
      responses:
        '200':
          $ref: '#/components/responses/CollectionAgencyLoanDetailsResponse'
      security:
        - oauth2:
            - loan:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Unassign loan collection agency
      tags:
        - Loan Collection Agencies
    get:
      operationId: peach.collections.handlers.collection_agency_loan_details_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      responses:
        '200':
          $ref: '#/components/responses/CollectionAgencyLoanDetailsResponse'
      security:
        - oauth2:
            - loan:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan collection agency
      tags:
        - Loan Collection Agencies
    post:
      description: >
        This end point allows lenders to assign a loan to a debt collection
        agency.

        When a loan is assigned to a debt collection agency, the system will set
        `servicedBy=debtCollectionAgency`.

        Once the loan is assigned, Peach system can only accept "external"
        transactions to update the loan balance (`isExternal=true`).
      operationId: peach.collections.handlers.collection_agency_loan_details_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/CollectionAgencyLoanDetailsPut'
      responses:
        '200':
          $ref: '#/components/responses/CollectionAgencyLoanDetailsResponse'
      security:
        - oauth2:
            - loan:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update loan collection agency
      tags:
        - Loan Collection Agencies
  /people/{personId}/loans/{loanId}/credit-limit:
    get:
      operationId: peach.people.loans.handlers.loan_get_credit_limit
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/effectiveDate'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/CreditLimitProperties'
                    type: object
          description: Success
      security:
        - oauth2:
            - loan:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan credit limit
      tags:
        - Loans
    post:
      operationId: peach.people.loans.handlers.loan_update_credit_limit
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreditLimitProperties'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/LineOfCredit'
                    type: object
          description: Success
      security:
        - oauth2:
            - loan:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update loan credit limit
      tags:
        - Loans
  /people/{personId}/loans/{loanId}/credit-reporting:
    get:
      operationId: peach.credit_reporting.handlers.credit_reporting_statuses_list
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      responses:
        '200':
          $ref: '#/components/responses/CreditReportingStatusPagingResponse'
      security:
        - oauth2:
            - credit.reporting.status:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get credit reporting statuses
      tags:
        - Credit Reporting
    post:
      description: Sets the starting date to begin reporting credit history for the loan.
      operationId: peach.credit_reporting.handlers.credit_reporting_status_create
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/CreditReportingStatusPost'
      responses:
        '200':
          $ref: '#/components/responses/CreditReportingStatusResponse'
      security:
        - oauth2:
            - credit.reporting.status:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Start credit reporting
      tags:
        - Credit Reporting
    put:
      description: Sets loan-level credit reporting fields
      operationId: peach.credit_reporting.handlers.credit_reporting_fields_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/CreditReportingFieldsPut'
      responses:
        '200':
          $ref: '#/components/responses/Loan'
      security:
        - oauth2:
            - loan:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update reporting fields
      tags:
        - Credit Reporting
  /people/{personId}/loans/{loanId}/credit-reporting/{creditAgencyId}/delete:
    post:
      operationId: peach.credit_reporting.handlers.credit_reporting_status_delete
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/creditAgencyId'
      requestBody:
        $ref: '#/components/requestBodies/CreditReportingStatusDelete'
      responses:
        '200':
          $ref: '#/components/responses/CreditReportingStatusResponse'
      security:
        - oauth2:
            - credit.reporting.status:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete from credit reporting
      tags:
        - Credit Reporting
  /people/{personId}/loans/{loanId}/custom-payment-plans:
    get:
      description: Returns all payment plans associated with a loan.
      operationId: peach.people.loans.handlers.loan_custom_payment_plan_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/customPaymentPlanStatusQuery'
      responses:
        '200':
          $ref: '#/components/responses/LoanCustomPaymentPlans'
      security:
        - oauth2:
            - loan.custompaymentplan:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get payment plans
      tags:
        - Payment Plans
    post:
      description: >
        Creates a custom payment plan for the borrower. `numberOfPeriods` is
        required. If `paymentPlanType=fixedAmountAndFees`,

        then the `amount` is required.


        Only applicable to installment loans.
      operationId: >-
        peach.people.loans.expected_payments.handlers.loan_custom_payment_plan_create
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/LoanCustomPaymentPlan'
      responses:
        '200':
          $ref: '#/components/responses/LoanCustomPaymentPlan'
      security:
        - oauth2:
            - loan.custompaymentplan:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create payment plan
      tags:
        - Payment Plans
  /people/{personId}/loans/{loanId}/custom-payment-plans/{paymentPlanId}:
    get:
      description: Return a single payment plan.
      operationId: peach.people.loans.handlers.loan_custom_payment_plan_get_by_id
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/paymentPlanId'
      responses:
        '200':
          $ref: '#/components/responses/LoanCustomPaymentPlan'
      security:
        - oauth2:
            - loan.custompaymentplan:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get payment plan by id
      tags:
        - Payment Plans
  /people/{personId}/loans/{loanId}/custom-payment-plans/{paymentPlanId}/cancel:
    post:
      description: >
        Use this endpoint to cancel a payment plan. Any existing payment plan
        must be canceled prior to creating a new payment plan.

        After canceling a payment plan, Peach's system will revert the loan
        schedule (from the current period onwards) to the previous

        recurring payment amount and frequency prior to creating the payment
        plan.


        As a result of cancellation, the loan duration and loan end date will be
        adjusted to match with the last non-zero expected payment,

        if required.
      operationId: peach.people.loans.handlers.loan_custom_payment_plan_cancel
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/paymentPlanId'
      requestBody:
        $ref: '#/components/requestBodies/LoanCustomPaymentPlanCancel'
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - loan.custompaymentplan:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Cancel payment plan
      tags:
        - Payment Plans
  /people/{personId}/loans/{loanId}/defer-due-date:
    post:
      description: >
        Defer single due date takes the amount in a selected due date and defers
        the amount to another due date in the

        future. The deferral amount can be moved to an existing due date or
        alternatively, to a new due date added after

        the last existing due date. These two options are mutually exclusive.


        Fees associated with the amount in the period to be deferred will not be
        moved.


        Limitations:

        - Cannot defer due date which is due on the day of the request. e.g.
        Cannot defer 1/31 on 1/31

        - Only applicable to installment loans.
      operationId: peach.people.loans.expected_payments.handlers.loan_due_date_defer
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/LoanDeferDueDate'
      responses:
        '200':
          $ref: '#/components/responses/LoanDeferDueDate'
      security:
        - oauth2:
            - loan:duedate.defer
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Defer installment single due date
      tags:
        - Expected Payments
  /people/{personId}/loans/{loanId}/defer-schedule:
    post:
      description: >
        Defer schedule allows lenders to shift the entire expected payments
        schedule. There are two use cases:


        Defer during the first period of the loan. In this scenario we "extend"
        the first period by

        the requested buffer (while honoring frequency and specific days). As a
        result, the first due

        date will be shifted in the future (and all subsequent due dates).


        Defer after the first period has passed. In this scenario, we defer all
        due dates that fall

        between "today's date" and "today's date + buffer days" to the end of
        the loan one by one.

        It will extend the term of the loan by the number of periods equal to
        number of due dates that were deferred.

        If the current date falls on a due date, it will not be deferred as the
        period has ended.


        Only applicable to installment loans.
      operationId: peach.people.loans.expected_payments.handlers.loan_schedule_defer
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/LoanDeferSchedule'
      responses:
        '200':
          $ref: '#/components/responses/LoanDeferSchedule'
      security:
        - oauth2:
            - loan:schedule.defer
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Defer installment schedule
      tags:
        - Expected Payments
  /people/{personId}/loans/{loanId}/disputes:
    get:
      operationId: peach.loans.purchase_disputes.handlers.purchase_disputes_list_for_loc
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/cardIds'
      responses:
        '200':
          $ref: '#/components/responses/PurchaseDisputePagingResponse'
      security:
        - oauth2:
            - purchase.dispute:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get line of credit purchase disputes
      tags:
        - Line of Credit Purchases
  /people/{personId}/loans/{loanId}/draws:
    get:
      operationId: peach.people.loans.draws.handlers.loan_draws_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/loanStatuses'
        - $ref: '#/components/parameters/isClosed'
        - $ref: '#/components/parameters/isAmortized'
        - $ref: '#/components/parameters/startedBefore'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
      responses:
        '200':
          $ref: '#/components/responses/DrawsPaging'
      security:
        - oauth2:
            - draw:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get draws
      tags:
        - Line of Credit Draws
    post:
      operationId: peach.people.loans.draws.handlers.loan_draws_post
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/DrawsPost'
      responses:
        '200':
          $ref: '#/components/responses/Draw'
      security:
        - oauth2:
            - draw:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create draw
      tags:
        - Line of Credit Draws
  /people/{personId}/loans/{loanId}/draws/{drawId}:
    get:
      operationId: peach.people.loans.draws.handlers.loan_draw_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
      responses:
        '200':
          $ref: '#/components/responses/Draw'
      security:
        - oauth2:
            - draw:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get draw by ID
      tags:
        - Line of Credit Draws
    put:
      operationId: peach.people.loans.draws.handlers.draw_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/contactValidate'
        - $ref: '#/components/parameters/forceLoanUpdate'
      requestBody:
        $ref: '#/components/requestBodies/DrawUpdate'
      responses:
        '200':
          $ref: '#/components/responses/Draw'
      security:
        - oauth2:
            - loan:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update draw
      tags:
        - Line of Credit Draws
  /people/{personId}/loans/{loanId}/draws/{drawId}/activate:
    post:
      operationId: peach.people.loans.draws.handlers.draw_activate
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/syncGeneric'
      responses:
        '200':
          $ref: '#/components/responses/DrawActivate'
        '408':
          description: Request Timeout
      security:
        - oauth2:
            - draw:activate
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Activate draw
      tags:
        - Line of Credit Draws
  /people/{personId}/loans/{loanId}/draws/{drawId}/amortize:
    post:
      description: >
        This endpoint is used for draw amortization. The draw must have non-due
        principal to be reamortized.


        Note:

        - If the loan type is configured to accrue interest as
        `accrualMethod=compoundWithFees`, there is a

        known limitation to the draw amortization calculation logic.

        - The draw amortization calculation will be done using the `compound`
        method and not `compoundWithFees`.

        To ensure that the system calculates interest accurately, amortized
        draws should NOT include any fees.
      operationId: peach.people.loans.draws.handlers.loan_draw_amortize
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                duration:
                  description: >
                    The new duration of the draw as a number of
                    `paymentFrequency` of the line of credit. Only applicable if
                    the draw

                    needs to be amortized. The caller needs to pass one of the
                    values only, `duration` or `recurringPaymentAmount`.


                    If this endpoint is called when the draw has already been
                    active for some number of periods, the `duration` parameter

                    will generate `duration` _additional_ periods from the time
                    at which the endpoint is called. For example, if a draw has

                    duration 10, and it is amortized again in period 5 with
                    `duration=10`, the result will be a draw with a total
                    duration of 15.
                  format: int32
                  type: integer
                previewMode:
                  default: false
                  description: >-
                    In `previewMode=true`, the draw doesn't change, and no
                    changes are saved to the database.
                  type: boolean
                recurringAmount:
                  description: >
                    The recurring payment amount. The system will calculate the
                    needed duration. Pass one of the values only,

                    `duration` or `recurringPaymentAmount`. This field is only
                    valid when the amortizationMethod on the loan type is

                    `equalPayments`.
                  format: float
                  type: number
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/LoanSchedule'
                    type: object
          description: Success
      security:
        - oauth2:
            - draw:amortize
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Amortize draw
      tags:
        - Line of Credit Draws
  /people/{personId}/loans/{loanId}/draws/{drawId}/balances:
    get:
      operationId: peach.people.loans.balances.handlers.draw_balances_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/isRounded'
        - $ref: '#/components/parameters/skipYtd'
        - $ref: '#/components/parameters/toEffectiveDate'
        - $ref: '#/components/parameters/skipInterestAccrual'
      responses:
        '200':
          $ref: '#/components/responses/Balances'
      security:
        - oauth2:
            - loan:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get draw balances
      tags:
        - Balances
  /people/{personId}/loans/{loanId}/draws/{drawId}/cancel:
    post:
      description: >
        The cancel loan endpoint will change the status of a draw to `canceled`,
        and

        trigger any cancellation-related logic.


        An active draw can be canceled if it has no active purchases.
      operationId: peach.people.loans.draws.handlers.draw_cancel
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/forceLoanCancel'
        - $ref: '#/components/parameters/clearAllExternalIdsLoanCancel'
        - $ref: '#/components/parameters/syncLoanCancel'
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                cancellationReason:
                  description: >
                    The cancellation reason:


                    `technicalIssue` - loan was created due to a technical
                    issue.


                    `wrongLoanTerms` - loan was created with the wrong terms.


                    `wrongBorrower` - loan was created on the wrong borrower.


                    `other` - for any other reason requiring cancellation.
                  enum:
                    - technicalIssue
                    - wrongLoanTerms
                    - wrongBorrower
                    - other
                  type: string
              type: object
        required: true
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - draw:cancel
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Cancel draw
      tags:
        - Line of Credit Draws
  /people/{personId}/loans/{loanId}/draws/{drawId}/close:
    post:
      description: >
        Closing a draw means that the draw can no longer accept new purchases.
        The draw will automatically transition

        to `paidOff` status once all of the following conditions are met:
          - The draw has no outstanding balance.
          - There are no pending transactions on the draw.
          - There are no pending, authorized, or blocking disputed purchases on the draw.

        A draw in `paidOff` status cannot be reopened.
      operationId: peach.people.loans.draws.handlers.draw_close
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                caseId:
                  description: An identifier for an existing case.
                  type: string
                closeRequestedByBorrower:
                  default: false
                  description: Set to true if a borrower requested to close the account.
                  type: boolean
              type: object
        required: true
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - loan:close
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Close draw
      tags:
        - Line of Credit Draws
  /people/{personId}/loans/{loanId}/draws/{drawId}/credit-limit:
    get:
      operationId: peach.people.loans.draws.handlers.draw_get_credit_limit
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/effectiveDate'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        allOf:
                          - properties:
                              creditLimitAmount:
                                description: The credit limit amount.
                                format: float
                                type: number
                            type: object
                          - $ref: '#/components/schemas/CaseId'
                    type: object
          description: Success
      security:
        - oauth2:
            - loan:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get draw credit limit
      tags:
        - Line of Credit Draws
    post:
      operationId: peach.people.loans.draws.handlers.draw_update_credit_limit
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    creditLimitAmount:
                      description: The credit limit amount.
                      format: float
                      type: number
                    creditLimitPercentage:
                      $ref: '#/components/schemas/CreditLimitPercentage'
                  type: object
                - $ref: '#/components/schemas/CaseId'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/DrawResponse'
                    type: object
          description: Success
      security:
        - oauth2:
            - loan:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update draw credit limit
      tags:
        - Line of Credit Draws
  /people/{personId}/loans/{loanId}/draws/{drawId}/disputes:
    get:
      operationId: peach.loans.purchase_disputes.handlers.purchase_disputes_list_for_draw
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/cardIds'
      responses:
        '200':
          $ref: '#/components/responses/PurchaseDisputePagingResponse'
      security:
        - oauth2:
            - purchase.dispute:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get draw purchase disputes
      tags:
        - Line of Credit Purchases
  /people/{personId}/loans/{loanId}/draws/{drawId}/dynamic-fees:
    put:
      description: >
        Allows lenders to add or remove dynamic fees from a draw going forward.
        This does not affect balances or fees in the past.
      operationId: peach.people.loans.fees.handlers.draw_dynamic_fees_at_origination_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AtOriginationDynamicFees'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/DynamicFeesAtOrigination'
      security:
        - oauth2:
            - loan:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update draw fees
      tags:
        - Line of Credit Draws
  /people/{personId}/loans/{loanId}/draws/{drawId}/effective-rates:
    get:
      description: >
        This endpoint returns rates details of a draw for a given date(s).

        Interest rates:

        If two or more interest rates are `active` on the same date (aka
        overlap), the Peach system selects the lowest rate (also called
        effective rate) to accrue interest.

        Promo rates:

        If two or more promo rates are `active` on the same date (aka overlap),
        the Peach system sums up the rates as "effective" promo rate.
      operationId: peach.people.loans.handlers.draw_effective_rates_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - description: >
            The from date. Pass the same value in the `fromDate` and `toDate` if
            you need to get the rates for a specific date.
          in: query
          name: fromDate
          schema:
            format: date
            type: string
        - description: >
            The to date. Pass the same value in the `fromDate` and `toDate` if
            you need to get the rates for a specific date.
          in: query
          name: toDate
          schema:
            format: date
            type: string
        - $ref: '#/components/parameters/effectiveRatesPeriodIdsQuery'
        - $ref: '#/components/parameters/effectiveRatesPeriodDueDatesQuery'
      responses:
        '200':
          $ref: '#/components/responses/LoanEffectiveRatesResponse'
      security:
        - oauth2:
            - rates:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get draw effective rates
      tags:
        - Rates
  /people/{personId}/loans/{loanId}/draws/{drawId}/expected-payments:
    get:
      operationId: peach.people.loans.expected_payments.handlers.draw_expected_payments_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
      responses:
        '200':
          $ref: '#/components/responses/ExpectedPayments'
      security:
        - oauth2:
            - loan:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get draw expected payments
      tags:
        - Expected Payments
  /people/{personId}/loans/{loanId}/draws/{drawId}/expected-payments/defer-remaining-balances:
    post:
      description: |
        Defer draw single or multiple due dates.
        The selected due dates to defer can only be due dates for which
        the statement was already generated.
        Past due dates should always have statements.
        Upcoming due date can only be selected if the statement was
        already generated.
      operationId: >-
        peach.people.loans.expected_payments.handlers.defer_remaining_draw_balances
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeferRemainingBalancesRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeferRemainingBalancesResponse'
          description: Success
      security:
        - oauth2:
            - loan:defer.remaining.balances
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Defer remaining balances for a draw
      tags:
        - Expected Payments
  /people/{personId}/loans/{loanId}/draws/{drawId}/fees/draw:
    put:
      description: >
        This endpoint allows lenders to change the draw fee amount. The system
        will update the draw fee amount and replay the loan from the draw
        activation date.
      operationId: peach.people.loans.handlers.update_draw_fee
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/syncGeneric'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                caseId:
                  description: An identifier for an existing case.
                  type: string
                feeAmount:
                  description: >
                    The updated amount of the draw fee. The new amount cannot be
                    higher than the amount passed on draw creation in
                    atOrigination.
                  type: number
              type: object
        required: true
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - loan:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update draw fee
      tags:
        - Fees
  /people/{personId}/loans/{loanId}/draws/{drawId}/future-balances:
    get:
      operationId: peach.people.loans.balances.handlers.draw_future_balances_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/isRounded'
      responses:
        '200':
          $ref: '#/components/responses/FutureBalances'
      security:
        - oauth2:
            - loan:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get draw future balances
      tags:
        - Balances
  /people/{personId}/loans/{loanId}/draws/{drawId}/migration/period:
    get:
      operationId: >-
        peach.loans.migration.migration_period.handlers.migration_period_draw_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MigrationPeriodDrawDataResponse'
          description: Migration period draw data
      security:
        - oauth2:
            - loan.migration.period:get
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get migration period draw data
      tags:
        - Line of Credit Migration
    post:
      description: >
        This endpoint allows you to pass additional details about draws in
        preparation for migration.


        The "migration period" is the period in which you execute the migration.
        This is the period from which the Peach system takes control over the
        line. This period is considered to be "open" at the time of the
        migration. The migration needs to be completed before the upcoming due
        date. To clarify, the upcoming due date corresponds to the previous
        period's statement date.


        The "Migration cutoff date" is the most recent statement date relative
        to the day on which you execute the migration process. This date is also
        the `startDate` of the migration period.


        The "Migration at date" is the actual date on which you execute the
        migration.


        For example:

        - Migration period:
          - startDate: Aug 1, 2024
          - endDate: Aug 31, 2024
          - statementDate: Sep 1, 2024
          - dueDate: Sep 22, 2024
        - Previous period (also called 'past period'):
          - startDate: Jul 1, 2024
          - endDate: Jul 31, 2024
          - statementDate: Aug 1, 2024
          - dueDate: Aug 22, 2024
        - Notes:
          - 'Migration cutoff date' is Aug 1, 2024.
          - If you execute the migration on Aug 10, 2024, the 'migration at date' is Aug 10.
          - Previous period's `dueDate`, Aug 22, 2024, falls in the 'migration period' that starts on Aug 1, 2024 and ends on Aug 31, 2024.
          - The upcoming due date is Aug 22, 2024.
          - If you didn't complete the migration before Aug 22, 2024, you need to cancel the loan and start the process again.
      operationId: >-
        peach.loans.migration.migration_period.handlers.migration_period_draw_create
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MigrationPeriodDrawDataWithRequired'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MigrationPeriodDrawDataResponse'
          description: Migration period draw data
      security:
        - oauth2:
            - loan.migration.period:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create migration period draw data
      tags:
        - Line of Credit Migration
    put:
      operationId: >-
        peach.loans.migration.migration_period.handlers.migration_period_draw_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MigrationPeriodDrawData'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MigrationPeriodDrawDataResponse'
          description: Migration period draw data
      security:
        - oauth2:
            - loan.migration.period:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update migration period draw data
      tags:
        - Line of Credit Migration
  /people/{personId}/loans/{loanId}/draws/{drawId}/min-payment-calculation:
    post:
      operationId: peach.people.loans.draws.handlers.draw_min_payment_calculation_post
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                minPaymentCalculation:
                  $ref: '#/components/schemas/MinPaymentCalculation'
              required:
                - minPaymentCalculation
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  minPaymentCalculation:
                    $ref: '#/components/schemas/MinPaymentCalculation'
                required:
                  - minPaymentCalculation
                type: object
          description: Success
      security:
        - oauth2:
            - loan:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update draw min pay calculation
      tags:
        - Line of Credit Draws
  /people/{personId}/loans/{loanId}/draws/{drawId}/obligations:
    get:
      operationId: peach.obligations.handlers.draw_obligations_get_all
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/periodIdQuery'
        - $ref: '#/components/parameters/obligationStatusQuery'
        - $ref: '#/components/parameters/loanPeriodFromDate'
        - $ref: '#/components/parameters/loanPeriodToDate'
        - $ref: '#/components/parameters/dueDate'
        - $ref: '#/components/parameters/isOpen'
      responses:
        '200':
          $ref: '#/components/responses/Obligations'
      security:
        - oauth2:
            - obligation:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get draw obligations
      tags:
        - Obligations
  /people/{personId}/loans/{loanId}/draws/{drawId}/obligations/{obligationId}:
    get:
      operationId: peach.obligations.handlers.draw_obligation_get_by_id
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/obligationId'
      responses:
        '200':
          $ref: '#/components/responses/Obligation'
      security:
        - oauth2:
            - obligation:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get draw obligation by ID
      tags:
        - Obligations
  /people/{personId}/loans/{loanId}/draws/{drawId}/promo-programs:
    post:
      operationId: peach.promo_programs.handlers.promo_program.promo_programs_draw_add
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
      requestBody:
        $ref: '#/components/requestBodies/PromoProgramPost'
      responses:
        '200':
          $ref: '#/components/responses/PromoProgram'
      security:
        - oauth2:
            - loan.promoprogram:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create promo program for draw
      tags:
        - Promo Programs
  /people/{personId}/loans/{loanId}/draws/{drawId}/promo-programs/{promoProgramId}:
    delete:
      operationId: peach.promo_programs.handlers.promo_program.promo_programs_draw_delete
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/promoProgramId'
        - $ref: '#/components/parameters/promoCancelReason'
        - description: |
            When set to `true` the system will send a
            `promoProgramCanceled` notice to the borrower.
          in: query
          name: sendNotice
          required: false
          schema:
            default: true
            type: boolean
        - description: The case object unique identifier.
          in: query
          name: caseId
          required: false
          schema:
            $ref: '#/components/schemas/AnyId'
      responses:
        '200':
          $ref: '#/components/responses/PromoProgramDelete'
      security:
        - oauth2:
            - loan.promoprogram:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Cancel promo program for draw
      tags:
        - Promo Programs
    get:
      operationId: peach.promo_programs.handlers.promo_program.promo_programs_draw_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/promoProgramId'
      responses:
        '200':
          $ref: '#/components/responses/PromoProgram'
      security:
        - oauth2:
            - loan.promoprogram:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get promo program for draw by ID
      tags:
        - Promo Programs
    put:
      description: |
        There a few restrictions on what can be updated.
        `promoTypeId` cannot be updated.
        If `status=pending` - any attribute except for `status` can be
        updated.
        To activate use the `Activate promo program` endpoint.
        If `status=active` - `promoType`, `status`, `promoDurationDays`
        and `promoStartDate` cannot be updated.
        If `status=canceled` -  `promoType`, `promoDurationDays` and
        `promoStartDate` cannot be updated.
        If `status=exercised` - no attributes can be updated.
      operationId: peach.promo_programs.handlers.promo_program.promo_programs_draw_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/promoProgramId'
      requestBody:
        $ref: '#/components/requestBodies/PromoProgramPutDraw'
      responses:
        '200':
          $ref: '#/components/responses/PromoProgram'
      security:
        - oauth2:
            - loan.promoprogram:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update promo program for draw
      tags:
        - Promo Programs
  /people/{personId}/loans/{loanId}/draws/{drawId}/promo-programs/{promoProgramId}/activate:
    post:
      operationId: peach.promo_programs.handlers.promo_program.promo_programs_draw_activate
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/promoProgramId'
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - loan.promoprogram:activate
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Activate promo program for draw
      tags:
        - Promo Programs
  /people/{personId}/loans/{loanId}/draws/{drawId}/purchases:
    get:
      operationId: peach.people.loans.purchases.handlers.draw_purchases_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/purchaseTypes'
        - $ref: '#/components/parameters/purchaseStatuses'
        - $ref: '#/components/parameters/parameters_cardIds'
        - $ref: '#/components/parameters/fromEffectiveAt'
        - $ref: '#/components/parameters/toEffectiveAt'
        - $ref: '#/components/parameters/fromCreatedAt'
        - $ref: '#/components/parameters/toCreatedAt'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/sortByEffectiveAt'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/Purchase'
                        type: array
                    type: object
          description: Purchases
      security:
        - oauth2:
            - draw.purchase:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get draw purchases
      tags:
        - Line of Credit Purchases
    post:
      operationId: peach.people.loans.purchases.handlers.draw_purchases_create
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/forcePurchaseOverCreditLimit'
        - $ref: '#/components/parameters/forceOverLimit'
        - $ref: '#/components/parameters/forceIfClosed'
        - $ref: '#/components/parameters/syncGeneric'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/CreatePurchase'
                - $ref: '#/components/schemas/PurchaseExtraInput'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseCreateOrUpdateResponse'
          description: Created
        '408':
          description: Request Timeout
      security:
        - oauth2:
            - draw.purchase:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create purchase
      tags:
        - Line of Credit Purchases
  /people/{personId}/loans/{loanId}/draws/{drawId}/purchases-timeline:
    get:
      description: >-
        Get draw purchases timeline is designed to provide a sequential ordering
        of purchases using specific purchase timestamps passed to Peach as part
        of the query parameters. To generate the timeline, Peach "inserts"
        purchases using the first available timestamp provided in the query
        parameters. For example, if `effectiveAt` and `authorizedAt` are
        provided in that order, Peach will

        - check first for an `effectiveAt` timestamp. If it exists, insert into
        timeline using `effectiveAt` timestamp.

        - if `effectiveAt` does not exist, check for `authorizedAt`. If it
        exists, insert into timeline using `authorizedAt` timestamp.

        - if neither exist, insert purchase into timeline using createdAt.
      operationId: peach.people.loans.purchases.handlers.draw_purchases_timeline_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/purchaseTypes'
        - $ref: '#/components/parameters/purchaseStatuses'
        - $ref: '#/components/parameters/parameters_cardIds'
        - $ref: '#/components/parameters/fromEffectiveAt'
        - $ref: '#/components/parameters/toEffectiveAt'
        - $ref: '#/components/parameters/fromCreatedAt'
        - $ref: '#/components/parameters/toCreatedAt'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/timelineOrdering'
        - $ref: '#/components/parameters/timelineSortOrder'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/Purchase'
                        type: array
                    type: object
          description: Purchases
      security:
        - oauth2:
            - draw.purchase:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get draw purchases timeline
      tags:
        - Line of Credit Purchases
  /people/{personId}/loans/{loanId}/draws/{drawId}/purchases/{purchaseId}:
    get:
      operationId: peach.people.loans.purchases.handlers.draw_purchase_get_one
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/purchaseId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/Purchase'
                    type: object
          description: Success
      security:
        - oauth2:
            - draw.purchase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get purchase by ID
      tags:
        - Line of Credit Purchases
    put:
      operationId: peach.people.loans.purchases.handlers.draw_purchase_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/purchaseId'
        - $ref: '#/components/parameters/forcePurchaseOverCreditLimit'
        - $ref: '#/components/parameters/forceOverLimit'
        - $ref: '#/components/parameters/forceIfClosed'
        - $ref: '#/components/parameters/syncGeneric'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurchaseUpdateInternal'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseCreateOrUpdateResponse'
          description: Updated
        '408':
          description: Request Timeout
        '423':
          $ref: '#/components/responses/LockedResponse'
      security:
        - oauth2:
            - draw.purchase:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update purchase
      tags:
        - Line of Credit Purchases
  /people/{personId}/loans/{loanId}/draws/{drawId}/purchases/{purchaseId}/disputes:
    get:
      operationId: >-
        peach.loans.purchase_disputes.handlers.purchase_disputes_list_for_purchase
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/purchaseId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
      responses:
        '200':
          $ref: '#/components/responses/PurchaseDisputePagingResponse'
      security:
        - oauth2:
            - purchase.dispute:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get purchase disputes
      tags:
        - Line of Credit Purchases
    post:
      description: >
        Creates a new purchase dispute. Purchases in `authorized` status may not
        be disputed. They must first 

        be written to the ledger by changing the status of the purchase or
        creating a new purchase object in 

        pending or settled status. Once one of those steps have been taken, the
        purchase may be disputed.  
      operationId: peach.loans.purchase_disputes.handlers.purchase_dispute_create
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/purchaseId'
      requestBody:
        $ref: '#/components/requestBodies/PurchaseDisputePost'
      responses:
        '200':
          $ref: '#/components/responses/PurchaseDisputeResponse'
        '423':
          $ref: '#/components/responses/LockedResponse'
      security:
        - oauth2:
            - purchase.dispute:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create purchase dispute
      tags:
        - Line of Credit Purchases
  /people/{personId}/loans/{loanId}/draws/{drawId}/purchases/{purchaseId}/disputes/{purchaseDisputeId}:
    get:
      operationId: peach.loans.purchase_disputes.handlers.purchase_dispute_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/purchaseId'
        - $ref: '#/components/parameters/purchaseDisputeId'
      responses:
        '200':
          $ref: '#/components/responses/PurchaseDisputeResponse'
      security:
        - oauth2:
            - purchase.dispute:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get purchase dispute by ID
      tags:
        - Line of Credit Purchases
    put:
      operationId: peach.loans.purchase_disputes.handlers.purchase_dispute_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/purchaseId'
        - $ref: '#/components/parameters/purchaseDisputeId'
        - $ref: '#/components/parameters/syncGeneric'
      requestBody:
        $ref: '#/components/requestBodies/PurchaseDisputePut'
      responses:
        '200':
          $ref: '#/components/responses/PurchaseDisputeResponse'
        '408':
          description: Request Timeout
        '423':
          $ref: '#/components/responses/LockedResponse'
      security:
        - oauth2:
            - purchase.dispute:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update purchase dispute
      tags:
        - Line of Credit Purchases
  /people/{personId}/loans/{loanId}/draws/{drawId}/rate-caps:
    get:
      operationId: peach.loans.rate_caps.handlers.draw_rate_caps_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
      responses:
        '200':
          $ref: '#/components/responses/RateCapsArray'
        '404':
          $ref: '#/components/responses/DrawNotFound'
      security:
        - oauth2:
            - rates:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get draw rate caps
      tags:
        - Rate Caps
    post:
      description: >
        This endpoint is used for adding rate caps to a draw. If two or 

        more rate caps overlap on the same date, we will use the lowest value. 

        This defines the maximum interest rate that can accrue on a draw 

        to ensure interest accrual never exceeds the cap. You can define the 

        `startDate` and `endDate` for each rate cap.


        If a rate cap is added for past periods and the interest rate exceeds
        the cap, 

        we will replay the loan to apply the capped rate. If a rate cap is added
        for 

        past periods and the effective interest rate is unchanged, we will not
        replay the loan. 


        - Example: A borrower on active duty needs their rate capped at 36% per 

        MLA regulations. If no `rateCap` is set, an index rate change could
        increase 

        the loan rate beyond the regulatory limit. 

        - Original rate: 28% `spread` + 5% index rate = 33% (under cap)

        - Updated rate: 28% `spread` + 9% index rate= 37% (over cap)
      operationId: peach.loans.rate_caps.handlers.draw_rate_cap_add
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
      requestBody:
        $ref: '#/components/requestBodies/RateCapAdd'
      responses:
        '200':
          $ref: '#/components/responses/RateCap'
        '400':
          $ref: '#/components/responses/responses-BadRequest'
        '404':
          $ref: '#/components/responses/DrawNotFound'
      security:
        - oauth2:
            - rates:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Add draw rate cap
      tags:
        - Rate Caps
  /people/{personId}/loans/{loanId}/draws/{drawId}/rate-caps/{rateCapId}:
    delete:
      description: >
        This endpoint is used for removing a single rate cap on a draw. 


        If a draw rate was capped at the `maxRate` and removing this rate 

        cap updates the effective interest rate, then we will replay the loan.
        If 

        a loan rate is not affected by the removal of this `maxRate`, 

        then we will not replay the loan. 
      operationId: peach.loans.rate_caps.handlers.draw_rate_cap_delete
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/rateCapId'
      responses:
        '200':
          $ref: '#/components/responses/RateCapDeleted'
        '404':
          $ref: '#/components/responses/DrawRateCapNotFound'
      security:
        - oauth2:
            - rates:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete draw rate cap
      tags:
        - Rate Caps
    put:
      description: >
        This endpoint is used for updating a single rate cap on a draw.


        If a rate cap is updated on a draw for past periods and the draw 

        rate exceeds the cap, we will replay the loan to apply the capped rate.

        If a rate cap is added for past periods and the draw rate is not
        affected 

        by the `maxRate` update, then we will not replay the loan. 
      operationId: peach.loans.rate_caps.handlers.draw_rate_cap_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/rateCapId'
      requestBody:
        $ref: '#/components/requestBodies/RateCapUpdate'
      responses:
        '200':
          $ref: '#/components/responses/RateCap'
        '400':
          $ref: '#/components/responses/responses-BadRequest'
        '404':
          $ref: '#/components/responses/DrawRateCapNotFound'
      security:
        - oauth2:
            - rates:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update draw rate cap
      tags:
        - Rate Caps
  /people/{personId}/loans/{loanId}/draws/{drawId}/rates:
    get:
      operationId: peach.people.loans.handlers.draw_rates_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
      responses:
        '200':
          $ref: '#/components/responses/LoanRatesResponse'
      security:
        - oauth2:
            - rates:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get draw rates
      tags:
        - Rates
    post:
      description: >
        This endpoint is used for adding rates. A draw can have multiple rates.
        If two or more `interestRate` overlap on the same date

        we use the lowest value. If two or more `promoRate` overlap on the same
        date, we take the sum of the promo rates for the given

        day, and cap this rate at the maximum interest rate for the given day
        (to avoid accruing negative interest).


        The added `interestRate` will default to the existing interest type set
        on the loan at the time of

        origination (see `atOrigination.interestRate.interestType` attribute).

        The added `interestRate` must be within the bounds of any corresponding
        minimum and maximum rate range

        configuration that is found on the loan type (if any).
      operationId: peach.people.loans.handlers.draw_rates_add
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
      requestBody:
        $ref: '#/components/requestBodies/LoanRateAdd'
      responses:
        '201':
          $ref: '#/components/responses/CreateOrUpdateInterestRatesResponse'
      security:
        - oauth2:
            - rates:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Add draw rate
      tags:
        - Rates
  /people/{personId}/loans/{loanId}/draws/{drawId}/rates/{rateId}:
    delete:
      description: >
        This endpoint is used for removing a single `interest` or `promo` rate.
        The deletion of an

        interest rate cannot lead to a gap in the loan where there is no
        reference rate.


        Rates where setAtActivation is `true` can only be deleted with a special
        force permission.
      operationId: peach.people.loans.handlers.draw_rates_delete
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/rateId'
        - $ref: '#/components/parameters/caseFilter'
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - rates:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Remove draw rate
      tags:
        - Rates
    put:
      description: >
        This endpoint is used for updating a single `interest` or `promo` rate
        (don't pass both in the same call). The updating of an

        interest rate cannot lead to a gap in the loan where there is no
        reference interest rate.
      operationId: peach.people.loans.handlers.draw_rates_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
        - $ref: '#/components/parameters/rateId'
      requestBody:
        $ref: '#/components/requestBodies/LoanRateUpdate'
      responses:
        '200':
          $ref: '#/components/responses/CreateOrUpdateInterestRatesResponse'
      security:
        - oauth2:
            - rates:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update draw rate
      tags:
        - Rates
  /people/{personId}/loans/{loanId}/draws/{drawId}/reopen:
    post:
      description: >
        Reopen a closed draw. This will allow new purchases to be added to the
        draw. By default, a draw in `paidOff`

        status cannot be reopened. Set `force` to `true` to reopen a `paidOff`
        draw (e.g. for a post-closure balance

        correction); its parent line of credit is also reopened if needed, but
        sibling draws are left untouched. No

        special permission is required beyond `loan:reopen`.
      operationId: peach.people.loans.draws.handlers.draw_reopen
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/drawId'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                caseId:
                  description: An identifier for an existing case.
                  type: string
                force:
                  default: false
                  description: >
                    If `true`, reopen the draw even when it is in `paidOff`
                    status, also reopening its parent line of credit if needed.
                    Sibling draws are not affected.
                  type: boolean
                reopenReason:
                  description: The reason the loan is being reopened.
                  type: string
              type: object
        required: true
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - loan:reopen
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Reopen draw
      tags:
        - Line of Credit Draws
  /people/{personId}/loans/{loanId}/effective-rates:
    get:
      description: >
        This endpoint returns rates details of a loan for given date(s).


        ## Interest rates:

        - If two or more interest rates are `active` on the same date (aka
        overlap), the Peach system selects the lowest rate (also called
        "effective rate") to accrue interest.

        Promo rates:

        - If two or more promo rates are `active` on the same date (aka
        overlap), the Peach system sums up the rates as "effective" promo rate.
      operationId: peach.people.loans.handlers.loan_effective_rates_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - description: >
            The "from" date (inclusive).


            Pass the same value in the `fromDate` and `toDate` if you need to
            get the rates for a specific date.
          in: query
          name: fromDate
          schema:
            format: date
            type: string
        - description: >
            The "to" date (inclusive).


            Pass the same value in the `fromDate` and `toDate` if you need to
            get the rates for a specific date.
          in: query
          name: toDate
          schema:
            format: date
            type: string
        - $ref: '#/components/parameters/effectiveRatesPeriodIdsQuery'
        - $ref: '#/components/parameters/effectiveRatesPeriodDueDatesQuery'
      responses:
        '200':
          $ref: '#/components/responses/LoanEffectiveRatesResponse'
      security:
        - oauth2:
            - rates:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan effective rates
      tags:
        - Rates
  /people/{personId}/loans/{loanId}/expected-payments:
    get:
      operationId: peach.people.loans.expected_payments.handlers.loan_expected_payments_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      responses:
        '200':
          $ref: '#/components/responses/ExpectedPayments'
      security:
        - oauth2:
            - loan:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan expected payments
      tags:
        - Expected Payments
    post:
      description: >
        Change due date allows the customer to change the frequency of a loan
        and/or the specific day(s) that

        due dates will fall on. This is not supported for loans with
        `periodCalculationType=statementDate`.


        For accounts/loans with `frequency!=singleTerm` (aka non-single term),
        modifications to the expected payments schedule resulting

        from Change Due Date do not impact the current period. Changes are only
        effective starting in the next period.


        For accounts/loans with `frequency=singleTerm`, only specific days can
        be modified. The change impacts the current (single)

        period of the loan. The caller must pass `dueDatesFrequency=singleTerm`.


        - Note: In certain circumstances when requesting a new `specificDays`,
        the first adjusted period (with the new `specificDays`) can be 

        pushed out an additional "cycle" in order to prevent the `dueDate` of
        the current period (with the current `specificDays`) from 

        falling outside the first adjusted period. To achieve this, the max
        `gapBetweenDueDates` may be exceeded. 
      operationId: >-
        peach.people.loans.expected_payments.handlers.loan_change_due_dates_schedule_post
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/DueDatesPost'
      responses:
        '200':
          $ref: '#/components/responses/ChangeSchedule'
      security:
        - oauth2:
            - due.date:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Change due dates schedule
      tags:
        - Expected Payments
  /people/{personId}/loans/{loanId}/expected-payments/defer-remaining-balances:
    post:
      description: |
        Defer line of credit single or multiple due dates.
        The system will defer amounts across the line of credit and all
        draws.
        The selected due dates to defer can only be due dates for which
        the statement was already generated.
        Past due dates should always have statements.
        Upcoming due date can only be selected if the statement was
        already generated.

        Note: If the line of credit has origination fee, unpaid
        origination fee cannot be deferred.
        Other balances can be deferred.
      operationId: >-
        peach.people.loans.expected_payments.handlers.defer_remaining_loc_balances
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeferRemainingBalancesRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeferRemainingBalancesResponse'
          description: Success
      security:
        - oauth2:
            - loan:defer.remaining.balances
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Defer remaining balances for all active draws
      tags:
        - Expected Payments
  /people/{personId}/loans/{loanId}/fees:
    get:
      operationId: peach.people.loans.fees.handlers.fees_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/includeDraws'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/NewPaginator'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/LoanFee'
                        type: array
                    type: object
          description: Success
      security:
        - oauth2:
            - loan:fees.list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get fees
      tags:
        - Fees
    post:
      operationId: peach.people.loans.fees.handlers.fees_post
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/syncGeneric'
      requestBody:
        $ref: '#/components/requestBodies/FeesPost'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/LoanFee'
                        type: array
                    type: object
          description: Success
        '409':
          description: Duplicate fee external id.
        '412':
          $ref: '#/components/responses/FeeNotCharged'
      security:
        - oauth2:
            - loan:charge.dynamicfee
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Charge dynamic fee
      tags:
        - Fees
  /people/{personId}/loans/{loanId}/fees/origination:
    put:
      description: >
        This endpoint allows lenders to change the origination fee amount. The
        system will update the origination fee amount and replay the loan from
        the activation date.
      operationId: peach.people.loans.handlers.update_origination_fee
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/syncGeneric'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                caseId:
                  description: An identifier for an existing case.
                  type: string
                feeAmount:
                  description: >
                    The updated amount of the origination fee. The new amount
                    cannot be higher than the amount passed on loan creation in
                    atOrigination.
                  type: number
              type: object
        required: true
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - loan:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update origination fee
      tags:
        - Fees
  /people/{personId}/loans/{loanId}/fees/{loanFeeId}:
    put:
      operationId: peach.people.loans.fees.handlers.dynamic_fee_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/loanFeeId'
        - $ref: '#/components/parameters/syncUpdateDynamicFee'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                caseId:
                  description: An identifier for an existing case.
                  type: string
                customDisplayName:
                  description: >
                    A custom description of the fee. If provided, this value
                    will be displayed in Peach UI/App and Statements

                    (or can be used by lender in their App). If the value is not
                    provided, the Peach UI/App and Statements

                    logic will use displayName attribute. To remind, the
                    displayName is populated from the fee type configuration
                    object.
                  nullable: true
                  type: string
                externalId:
                  description: The lender's identifier for the fee.
                  nullable: true
                  type: string
                originalAmount:
                  description: >
                    The updated amount of the dynamic fee. Only applies to
                    dynamic fees. Only applicable if dynamic fee type

                    `capLogic.annualAmountCaps.capAction` = `adjustAmount` and
                    `capLogic.annualAmountCaps.type` in

                    [`annualPercentageOfCreditLimitCap`].
                  type: number
              type: object
        required: true
      responses:
        '204':
          description: Updated.
        '409':
          description: Duplicate fee external id.
        '423':
          $ref: '#/components/responses/LockedResponse'
      security:
        - oauth2:
            - loan:fees.update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update dynamic fee
      tags:
        - Fees
  /people/{personId}/loans/{loanId}/fees/{loanFeeId}/cancel:
    post:
      operationId: peach.people.loans.fees.handlers.fees_cancel_one
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/loanFeeId'
        - $ref: '#/components/parameters/clearExternalIdGeneric'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                caseId:
                  description: An identifier for an existing case.
                  type: string
              type: object
        required: false
      responses:
        '204':
          description: Canceled
        '423':
          $ref: '#/components/responses/LockedResponse'
      security:
        - oauth2:
            - loan:cancel.dynamicfee
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Cancel dynamic fee
      tags:
        - Fees
  /people/{personId}/loans/{loanId}/freeze:
    post:
      description: >
        Freeze loan will change the status of an `active` loan to `frozen`
        effective as of the

        current date. The loan will remain in a frozen status until the Unfreeze
        endpoint is

        called.
      operationId: peach.people.loans.handlers.loan_freeze
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                caseId:
                  description: An identifier for an existing case.
                  type: string
                sendNotice:
                  default: true
                  description: >
                    When set to `false`, the system will NOT send a `loanFreeze`
                    notice to the borrower.
                  type: boolean
              type: object
        required: true
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - loan:freeze
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Freeze loan
      tags:
        - Loans
  /people/{personId}/loans/{loanId}/future-balances:
    get:
      operationId: peach.people.loans.balances.handlers.loan_future_balances_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/isRounded'
      responses:
        '200':
          $ref: '#/components/responses/FutureBalances'
      security:
        - oauth2:
            - loan:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan future balances
      tags:
        - Balances
  /people/{personId}/loans/{loanId}/interest:
    get:
      operationId: peach.people.loans.handlers.loan_interest_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - description: The draw identifier, if getting interest for a specific draw.
          in: query
          name: drawId
          required: false
          schema:
            $ref: '#/components/schemas/AnyId'
        - $ref: '#/components/parameters/fromEffectiveDate'
        - $ref: '#/components/parameters/toEffectiveDate'
      responses:
        '200':
          $ref: '#/components/responses/Interest'
      security:
        - oauth2:
            - loan.interest:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan interest
      tags:
        - Balances
  /people/{personId}/loans/{loanId}/investors:
    get:
      operationId: peach.people.loans.handlers.loan_investors_get_all
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoanInvestorsPaging'
          description: success
      security:
        - oauth2:
            - loan:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan investors
      tags:
        - LoansInvestors
    put:
      operationId: peach.people.loans.handlers.loan_investors_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoanInvestors'
        required: true
      responses:
        '204':
          description: updated
      security:
        - oauth2:
            - loan.investors:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update loan investors
      tags:
        - LoansInvestors
  /people/{personId}/loans/{loanId}/loc-payment-plan-scra:
    delete:
      description: >
        Removes a single SCRA interest rate (`interestType=AbsoluteScra`) on a
        line of credit loan.


        The specified `rateId` must refer to an active SCRA interest rate on the
        loan.
      operationId: >-
        peach.people.loans.expected_payments.handlers.loc_change_terms_scra_delete
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/scraRateId'
        - $ref: '#/components/parameters/locScraSendNotice'
        - $ref: '#/components/parameters/scraCaseId'
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - loan:paymentplan.scra.delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete line of credit loan terms SCRA
      tags:
        - SCRA
    post:
      description: >
        Creates SCRA (Servicemembers Civil Relief Act) terms for a line of
        credit loan.


        For the SCRA period, the loan rate is lowered (default 6%) and fees may
        be canceled.

        Only applicable to line of credit loans.


        The `startDate` must be before or equal to `endDate`, and both must fall
        within

        the loan's lifetime. The `annualRate` cannot exceed 6% per US federal
        regulations.

        Overlapping SCRA periods are not allowed.
      operationId: >-
        peach.people.loans.expected_payments.handlers.loc_change_terms_scra_create
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/syncGeneric'
      requestBody:
        $ref: '#/components/requestBodies/LocChangeLoanTermsSCRA'
      responses:
        '200':
          $ref: '#/components/responses/LocChangeScheduleSCRA'
      security:
        - oauth2:
            - loan:paymentplan.scra.create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create line of credit loan terms SCRA
      tags:
        - SCRA
    put:
      description: >
        Modifies the start date or end date of a single SCRA interest rate
        (`interestType=AbsoluteScra`)

        on a line of credit loan.


        The new `startDate` must be before or equal to `endDate`, and both must
        fall within

        the loan's lifetime. The modified SCRA period must not overlap with
        other SCRA plans.
      operationId: >-
        peach.people.loans.expected_payments.handlers.loc_change_terms_scra_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/LocChangeLoanTermsSCRAUpdate'
      responses:
        '200':
          $ref: '#/components/responses/LocChangeScheduleSCRA'
      security:
        - oauth2:
            - loan:paymentplan.scra.update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Change line of credit loan terms SCRA
      tags:
        - SCRA
  /people/{personId}/loans/{loanId}/lock-status:
    get:
      operationId: peach.people.loans.handlers.get_lock_status
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/IsLocked'
                    type: object
          description: Succeeded
      security:
        - oauth2:
            - loan:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan lock status
      tags:
        - Loans
  /people/{personId}/loans/{loanId}/migrate:
    post:
      operationId: peach.loans.migration.handlers.loan_migrate
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/syncGeneric'
      responses:
        '204':
          description: Loan migration started
        '408':
          description: Request Timeout
      security:
        - oauth2:
            - loan:migrate
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Migrate loan
      tags:
        - Loans
  /people/{personId}/loans/{loanId}/migration/past-periods:
    delete:
      description: Deletes past period in preparation for migration.
      operationId: peach.loans.migration.past_periods.handlers.past_periods_data_delete
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/dueDateDelete'
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - loan.migration.pastperiods:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete past period data
      tags:
        - Line of Credit Migration
    get:
      description: Get past period in preparation for migration.
      operationId: peach.loans.migration.past_periods.handlers.past_periods_data_list
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/dueDateGet'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/reportingToAgency'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/NewPaginator'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/PastPeriod'
                        type: array
                    type: object
          description: Past period data
      security:
        - oauth2:
            - loan.migration.pastperiods:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get past period data
      tags:
        - Line of Credit Migration
    post:
      description: Creates past periods in preparation for migration.
      operationId: peach.loans.migration.past_periods.handlers.past_periods_data_create
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                pastPeriods:
                  items:
                    $ref: '#/components/schemas/PastPeriodWithRequireds'
                  type: array
              required:
                - pastPeriods
              type: object
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/PastPeriod'
                        type: array
                    type: object
          description: Success
      security:
        - oauth2:
            - loan.migration.pastperiods:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create past periods data
      tags:
        - Line of Credit Migration
    put:
      description: Updates past period in preparation for migration.
      operationId: peach.loans.migration.past_periods.handlers.past_periods_data_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/dueDateUpdate'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PastPeriod'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/PastPeriod'
                    type: object
          description: Success
      security:
        - oauth2:
            - loan.migration.pastperiods:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update past period data
      tags:
        - Line of Credit Migration
  /people/{personId}/loans/{loanId}/migration/past-transaction:
    get:
      operationId: >-
        peach.loans.migration.past_transactions.handlers.past_transaction_data_get_all
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/transactionStatuses'
        - $ref: '#/components/parameters/queryPaymentInstrumentId'
        - $ref: '#/components/parameters/transactionType'
        - $ref: '#/components/parameters/serviceCreditTypes'
        - $ref: '#/components/parameters/toEffectiveDateGeneric'
        - $ref: '#/components/parameters/fromEffectiveDateGeneric'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/sortByForTransactions'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PastTransactionsPaging'
          description: Success
      security:
        - oauth2:
            - loan.migration.pasttransaction:get
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get past transactions
      tags:
        - Line of Credit Migration
    post:
      description: Creates past transaction in preparation for line of credit migration.
      operationId: >-
        peach.loans.migration.past_transactions.handlers.past_transaction_data_create
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PastTransaction'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/PastTransactionResponse'
                    type: object
          description: Created
      security:
        - oauth2:
            - loan.migration.pasttransaction:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create past transaction
      tags:
        - Line of Credit Migration
  /people/{personId}/loans/{loanId}/migration/past-transaction/{transactionId}:
    get:
      operationId: >-
        peach.loans.migration.past_transactions.handlers.past_transaction_data_get_one
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/transactionId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/PastTransactionResponse'
                    type: object
          description: Success
      security:
        - oauth2:
            - loan.migration.pasttransaction:get
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get past transaction by ID
      tags:
        - Line of Credit Migration
    put:
      description: >
        Update past transaction in preparation for line of credit migration.


        Note: After migration, you should call the "Update transaction"
        endpoint.
      operationId: >-
        peach.loans.migration.past_transactions.handlers.past_transaction_data_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/transactionId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PastTransactionUpdate'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/PastTransactionResponse'
                    type: object
          description: Success
      security:
        - oauth2:
            - loan.migration.pasttransaction:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update past transaction
      tags:
        - Line of Credit Migration
  /people/{personId}/loans/{loanId}/migration/period:
    get:
      operationId: peach.loans.migration.migration_period.handlers.migration_period_loc_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MigrationPeriodLOCDataResponse'
          description: Migration period LOC data
      security:
        - oauth2:
            - loan.migration.period:get
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get migration period LOC data
      tags:
        - Line of Credit Migration
    post:
      description: >
        This endpoint allows you to pass additional details about the line in
        preparation for migration.


        The "Migration period" is the period in which you execute the migration.
        This is the period from which the Peach system takes control over the
        line. This period is considered to be "open" at the time of the
        migration. The migration needs to be completed before the upcoming due
        date. To clarify, the upcoming due date corresponds to the previous
        period's statement date.


        "Migration cutoff date" is the most recent statement date relative to
        the day on which you execute the migration process. This date is also
        the `startDate` of the migration period.


        "Migration at date" is the actual date on which you execute the
        migration.


        For example:
         - Migration period:
            - startDate: Aug 1, 2024
            - endDate: Aug 31, 2024
            - statementDate: Sep 1, 2024
            - dueDate: Sep 22, 2024
         - Previous period (also called "past period"):
            - startDate: Jul 1, 2024
            - endDate: Jul 31, 2024
            - statementDate: Aug 1, 2024
            - dueDate: Aug 22, 2024
         - Notes:
            - "Migration cutoff date" is Aug 1, 2024.
            - If you execute the migration on Aug 10, 2024, the "migration at date" is Aug 10.
            - Previous period's `dueDate`, Aug 22, 2024, falls in the "migration period" that starts on Aug 1, 2024 and ends on Aug 31, 2024.
            - The upcoming due date is Aug 22, 2024.
         - If you didn't complete the migration before Aug 22, 2024, you need to cancel the loan and start the process again.
      operationId: >-
        peach.loans.migration.migration_period.handlers.migration_period_loc_create
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MigrationPeriodLOCDataWithRequired'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MigrationPeriodLOCDataResponse'
          description: Migration period LOC data
      security:
        - oauth2:
            - loan.migration.period:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create migration period LOC data
      tags:
        - Line of Credit Migration
    put:
      operationId: >-
        peach.loans.migration.migration_period.handlers.migration_period_loc_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MigrationPeriodLOCData'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MigrationPeriodLOCDataResponse'
          description: Migration period LOC data
      security:
        - oauth2:
            - loan.migration.period:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update migration period LOC data
      tags:
        - Line of Credit Migration
  /people/{personId}/loans/{loanId}/obligations:
    get:
      operationId: peach.obligations.handlers.obligations_get_all
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/periodIdQuery'
        - $ref: '#/components/parameters/obligationStatusQuery'
        - $ref: '#/components/parameters/loanPeriodFromDate'
        - $ref: '#/components/parameters/loanPeriodToDate'
        - $ref: '#/components/parameters/dueDate'
        - $ref: '#/components/parameters/isOpen'
      responses:
        '200':
          $ref: '#/components/responses/LOCObligations'
      security:
        - oauth2:
            - obligation:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan obligations
      tags:
        - Obligations
  /people/{personId}/loans/{loanId}/obligations/{obligationId}:
    get:
      operationId: peach.obligations.handlers.obligation_get_by_id
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/obligationId'
      responses:
        '200':
          $ref: '#/components/responses/LOCObligation'
      security:
        - oauth2:
            - obligation:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan obligation by ID
      tags:
        - Obligations
  /people/{personId}/loans/{loanId}/payment-plan:
    post:
      description: >
        Change loan terms creates a customer payment plan for the borrower.
        There are several options:


        The first option is passing in `duration`, which we use to calculate the
        new recurring amount going forward.

        The second option is passing in the `recurringAmount`, which we use to
        calculate the remaining duration of

        the loan. The third option is not passing either `duration` or
        `recurringAmount`, in which case the behavior

        is similar to the Change Due Date endpoint. The fourth option is passing
        `duration` and `recurringAmount`, which

        we use to calculate the final payment amount


        Unlike the Change Due Date endpoint, for the Change Loan Terms endpoint,
        any modifications to the `amount` in

        the expected payments schedule resulting from Change Loan Terms are
        effective from the current period. But

        modifications to the `dueDate` in the expected payments schedule are
        only effective starting in the next period.


        For all four options, it is optional to specify a new frequency and/or
        specific days. Change loan terms will cancel any due date deferrals

        for the current or future periods.


        Only applicable to installment loans.
      operationId: peach.people.loans.expected_payments.handlers.loan_change_terms
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/LoanChangeLoanTerms'
      responses:
        '200':
          $ref: '#/components/responses/ChangeSchedule'
      security:
        - oauth2:
            - loan:paymentplan.create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Change installment loan terms
      tags:
        - Expected Payments
  /people/{personId}/loans/{loanId}/payment-plan-scra:
    delete:
      description: >
        This endpoint is used for removing a single SCRA interest rate
        (`interestType=AbsoluteScra`) on a loan. Only applicable to installment
        loans. 


        If the SCRA start date is in the past, this will replay the loan.


        When an existing SCRA plan is updated or deleted, the system determines
        whether fees should be canceled or revived based on the `isCancelFees`
        value from the original SCRA plan.

        For example, if we are updating the SCRA plan:


        Expanding the SCRA period

        - If `isCancelFees` = `true`, we will cancel fees within the extended
        SCRA plan period.

        - If `isCancelFees` = `false`, we will not cancel any fees within the
        extended SCRA plan period.


        Shrinking the SCRA period

        - If `isCancelFees` = `true`, we will revive any previously canceled
        fees within the portion of the SCRA plan period that is being removed.

        - If `isCancelFees` = `false`, we will not revive any fees since there
        were no fees canceled in the original SCRA plan.
      operationId: >-
        peach.people.loans.expected_payments.handlers.loan_change_terms_scra_delete
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/scraRateId'
        - $ref: '#/components/parameters/scraSendNotice'
        - $ref: '#/components/parameters/scraCaseId'
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - loan:paymentplan.scra.delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete installment loan terms SCRA
      tags:
        - SCRA
    post:
      description: >
        Creates a customer payment plan for the borrower in accordance with SCRA
        regulations.

        Only applicable to installment loans.
      operationId: >-
        peach.people.loans.expected_payments.handlers.loan_change_terms_scra_create
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/syncGeneric'
      requestBody:
        $ref: '#/components/requestBodies/LoanChangeLoanTermsSCRA'
      responses:
        '200':
          $ref: '#/components/responses/ChangeScheduleSCRA'
      security:
        - oauth2:
            - loan:paymentplan.scra.create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create installment loan terms SCRA
      tags:
        - SCRA
    put:
      description: >
        This endpoint is used for modifying the start date or end date of a
        single SCRA interest rate (`interestType=AbsoluteScra`).

        Only applicable to installment loans.


        If the SCRA start date is in the past, this will replay the loan.


        When an existing SCRA plan is updated or deleted, the system determines
        whether fees should be canceled or revived based on the `isCancelFees`
        value from the original SCRA plan.

        For example, if we are updating the SCRA plan:


        Expanding the SCRA period

        - If `isCancelFees` = `true`, we will cancel fees within the extended
        SCRA plan period.

        - If `isCancelFees` = `false`, we will not cancel any fees within the
        extended SCRA plan period.


        Shrinking the SCRA period

        - If `isCancelFees` = `true`, we will revive any previously canceled
        fees within the portion of the SCRA plan period that is being removed.

        - If `isCancelFees` = `false`, we will not revive any fees since there
        were no fees canceled in the original SCRA plan.
      operationId: >-
        peach.people.loans.expected_payments.handlers.loan_change_terms_scra_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/LoanChangeLoanTermsSCRAUpdate'
      responses:
        '200':
          $ref: '#/components/responses/ChangeScheduleSCRA'
      security:
        - oauth2:
            - loan:paymentplan.scra.update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Change installment loan terms SCRA
      tags:
        - SCRA
  /people/{personId}/loans/{loanId}/periods:
    get:
      description: Returns loan's payment periods.
      operationId: peach.people.loans.handlers.get_loan_periods
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/loanPeriodFromDate'
        - $ref: '#/components/parameters/loanPeriodToDate'
        - $ref: '#/components/parameters/dueDate'
      responses:
        '200':
          $ref: '#/components/responses/LoanPeriodsResponse'
      security:
        - oauth2:
            - loan:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan periods
      tags:
        - Periods
  /people/{personId}/loans/{loanId}/periods/{loanPeriodId}:
    get:
      description: Returns a single loan period
      operationId: peach.people.loans.handlers.get_loan_period_by_id
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/loanPeriodId'
      responses:
        '200':
          $ref: '#/components/responses/LoanPeriodResponse'
      security:
        - oauth2:
            - loan:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan period by id
      tags:
        - Periods
  /people/{personId}/loans/{loanId}/periods/{periodId}/generate-statement:
    post:
      description: >
        Generates a statement, and if one already exists, replaces the older one
        as the active one.

        If `sync=true` is passed, the server will try to wait up to 20 seconds
        for the statement

        creation to finish. If it finishes in time, it will return the statement
        object.

        Otherwise, it will return nothing.
      operationId: peach.statements.handlers.generate_statement
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/periodId'
        - $ref: '#/components/parameters/syncGeneric'
        - $ref: '#/components/parameters/sendNotice'
        - $ref: '#/components/parameters/statementReason'
      responses:
        '201':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ProcessingCompleteGeneric'
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/schemas-Statement'
                    type: object
          description: Success
      security:
        - oauth2:
            - statement:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Generate statement
      tags:
        - Statements
  /people/{personId}/loans/{loanId}/promise-to-pay-plans:
    get:
      description: Returns `Promise to Pay Plan`s for a given `Loan`.
      operationId: peach.loans.promise_to_pays.handlers.get_promise_to_pay_plans_by_loan
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/parameters-status'
        - $ref: '#/components/parameters/isOverdue'
        - $ref: '#/components/parameters/startDateAfter'
        - $ref: '#/components/parameters/endDateBefore'
      responses:
        '200':
          $ref: '#/components/responses/PromisetoPayPlansPaging'
      security:
        - oauth2:
            - promise.to.pay.plan:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get Promise to Pay Plans for a Loan
      tags:
        - Promise to Pay Plans
    post:
      description: Creates a new `Promise to Pay Plan`.
      operationId: peach.loans.promise_to_pays.handlers.create_promise_to_pay_plan
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/PromiseToPayPlanPost'
      responses:
        '200':
          $ref: '#/components/responses/PromiseToPayPlan'
          description: >-
            Successfully processed the request, but the resource was not
            created.
        '201':
          $ref: '#/components/responses/PromiseToPayPlan'
          description: Successfully created a new Promise to Pay Plan.
      security:
        - oauth2:
            - promise.to.pay.plan:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create Promise to Pay Plan
      tags:
        - Promise to Pay Plans
  /people/{personId}/loans/{loanId}/promise-to-pay-plans/{promiseToPayPlanId}:
    get:
      description: Returns a `Promise to Pay Plan` for a given `Loan`.
      operationId: peach.loans.promise_to_pays.handlers.get_promise_to_pay_plan
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/promiseToPayPlanId'
      responses:
        '200':
          $ref: '#/components/responses/PromiseToPayPlan'
          description: Successfully fetched the Promise to Pay Plan.
      security:
        - oauth2:
            - promise.to.pay.plan:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get Promise to Pay Plan
      tags:
        - Promise to Pay Plans
  /people/{personId}/loans/{loanId}/promise-to-pay-plans/{promiseToPayPlanId}/cancel:
    put:
      description: Cancels a `Promise to Pay Plan`.
      operationId: peach.loans.promise_to_pays.handlers.cancel_promise_to_pay_plan
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/promiseToPayPlanId'
      requestBody:
        $ref: '#/components/requestBodies/PromiseToPayPlanCancel'
      responses:
        '200':
          $ref: '#/components/responses/PromiseToPayPlan'
          description: Successfully canceled the Promise to Pay Plan.
      security:
        - oauth2:
            - promise.to.pay.plan:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Cancel Promise to Pay Plan
      tags:
        - Promise to Pay Plans
  /people/{personId}/loans/{loanId}/promise-to-pay-plans/{promiseToPayPlanId}/evaluate:
    put:
      description: >-
        Evaluates a `Promise to Pay Plan` and updates the `status` and
        `isOverdue` of the `Promise to Pay Plan`.
      operationId: peach.loans.promise_to_pays.handlers.evaluate_promise_to_pay_plan
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/promiseToPayPlanId'
      responses:
        '200':
          $ref: '#/components/responses/PromiseToPayPlan'
          description: Successfully evaluated the Promise to Pay Plan.
      security:
        - oauth2:
            - promise.to.pay.plan:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Evaluate Promise to Pay Plan
      tags:
        - Promise to Pay Plans
  /people/{personId}/loans/{loanId}/promo-programs:
    get:
      operationId: peach.promo_programs.handlers.promo_program.promo_programs_get_all
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/promoEffectiveEndDateAfter'
        - $ref: '#/components/parameters/statuses'
      responses:
        '200':
          $ref: '#/components/responses/PromoProgramPaging'
      security:
        - oauth2:
            - loan.promoprogram:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get promo programs
      tags:
        - Promo Programs
    post:
      operationId: peach.promo_programs.handlers.promo_program.promo_programs_add
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/PromoProgramPost'
      responses:
        '200':
          $ref: '#/components/responses/PromoProgram'
      security:
        - oauth2:
            - loan.promoprogram:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create promo program
      tags:
        - Promo Programs
  /people/{personId}/loans/{loanId}/promo-programs/{promoProgramId}:
    delete:
      operationId: peach.promo_programs.handlers.promo_program.promo_programs_delete
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/promoProgramId'
        - $ref: '#/components/parameters/promoCancelReason'
        - description: |
            When set to `true` the system will send a
            `promoProgramCanceled` notice to the borrower.
          in: query
          name: sendNotice
          required: false
          schema:
            default: true
            type: boolean
        - description: The case object unique identifier.
          in: query
          name: caseId
          required: false
          schema:
            $ref: '#/components/schemas/AnyId'
      responses:
        '200':
          $ref: '#/components/responses/PromoProgramDelete'
      security:
        - oauth2:
            - loan.promoprogram:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Cancel promo program
      tags:
        - Promo Programs
    get:
      operationId: peach.promo_programs.handlers.promo_program.promo_programs_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/promoProgramId'
      responses:
        '200':
          $ref: '#/components/responses/PromoProgram'
      security:
        - oauth2:
            - loan.promoprogram:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get promo program by ID
      tags:
        - Promo Programs
    put:
      description: |
        There a few restrictions on what can be updated.
        `promoTypeId` cannot be updated.
        If `status=pending` - any attribute except for `status` can be
        updated.
        To activate use the `Activate promo program` endpoint.
        If `status=active` - `promoType`, `status`, `promoDurationDays`
        and `promoStartDate` cannot be updated.
        If `status=canceled` -  `promoType`, `promoDurationDays` and
        `promoStartDate` cannot be updated.
        If `status=exercised` - no attributes can be updated.
      operationId: peach.promo_programs.handlers.promo_program.promo_programs_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/promoProgramId'
      requestBody:
        $ref: '#/components/requestBodies/PromoProgramPut'
      responses:
        '200':
          $ref: '#/components/responses/PromoProgram'
      security:
        - oauth2:
            - loan.promoprogram:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update promo program
      tags:
        - Promo Programs
  /people/{personId}/loans/{loanId}/promo-programs/{promoProgramId}/activate:
    post:
      operationId: peach.promo_programs.handlers.promo_program.promo_programs_activate
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/promoProgramId'
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - loan.promoprogram:activate
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Activate promo program
      tags:
        - Promo Programs
  /people/{personId}/loans/{loanId}/purchases:
    get:
      operationId: peach.people.loans.purchases.handlers.loan_purchases_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/purchaseTypes'
        - $ref: '#/components/parameters/purchaseStatuses'
        - $ref: '#/components/parameters/parameters_cardIds'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/fromEffectiveAt'
        - $ref: '#/components/parameters/toEffectiveAt'
        - $ref: '#/components/parameters/fromCreatedAt'
        - $ref: '#/components/parameters/toCreatedAt'
        - $ref: '#/components/parameters/sortByEffectiveAt'
      responses:
        '200':
          $ref: '#/components/responses/PurchasesPaging'
      security:
        - oauth2:
            - draw.purchase:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get line of credit purchases
      tags:
        - Line of Credit Purchases
  /people/{personId}/loans/{loanId}/purchases-timeline:
    get:
      description: >-
        Get line of credit purchases timeline is designed to provide a
        sequential ordering of purchases using specific purchase timestamps
        passed to Peach as part of the query parameters. To generate the
        timeline, Peach "inserts" purchases using the first available timestamp
        provided in the query parameters. For example, if `effectiveAt` and
        `authorizedAt` are provided in that order, Peach will

        - check first for an `effectiveAt` timestamp. If it exists, insert into
        timeline using `effectiveAt` timestamp.

        - if `effectiveAt` does not exist, check for `authorizedAt`. If it
        exists, insert into timeline using `authorizedAt` timestamp.

        - if neither exist, insert purchase into timeline using createdAt.
      operationId: peach.people.loans.purchases.handlers.loan_purchases_timeline_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/purchaseTypes'
        - $ref: '#/components/parameters/purchaseStatuses'
        - $ref: '#/components/parameters/parameters_cardIds'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/fromEffectiveAt'
        - $ref: '#/components/parameters/toEffectiveAt'
        - $ref: '#/components/parameters/fromCreatedAt'
        - $ref: '#/components/parameters/toCreatedAt'
        - $ref: '#/components/parameters/timelineOrdering'
        - $ref: '#/components/parameters/timelineSortOrder'
      responses:
        '200':
          $ref: '#/components/responses/PurchasesPaging'
      security:
        - oauth2:
            - draw.purchase:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get line of credit purchases timeline
      tags:
        - Line of Credit Purchases
  /people/{personId}/loans/{loanId}/rate-caps:
    get:
      operationId: peach.loans.rate_caps.handlers.loan_rate_caps_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      responses:
        '200':
          $ref: '#/components/responses/RateCapsArray'
        '404':
          $ref: '#/components/responses/LoanNotFound'
      security:
        - oauth2:
            - rates:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan rate caps
      tags:
        - Rate Caps
    post:
      description: >
        This endpoint is used for adding rate caps to a loan. If two or 

        more rate caps overlap on the same date, we will use the lowest value. 

        This defines the maximum interest rate that can accrue on a loan 

        to ensure interest accrual never exceeds the cap. You can define the 

        `startDate` and `endDate` for each rate cap.


        If a rate cap is added for past periods and the interest rate exceeds
        the cap, 

        we will replay the loan to apply the capped rate. If a rate cap is added
        for 

        past periods and the effective interest rate is unchanged, we will not
        replay the loan. 


        - Example: A borrower on active duty needs their rate capped at 36% per 

        MLA regulations. If no `rateCap` is set, an index rate change could
        increase 

        the loan rate beyond the regulatory limit. 

        - Original rate: 28% `spread` + 5% index rate = 33% (under cap)

        - Updated rate: 28% `spread` + 9% index rate= 37% (over cap)
      operationId: peach.loans.rate_caps.handlers.loan_rate_cap_add
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/RateCapAdd'
      responses:
        '200':
          $ref: '#/components/responses/RateCap'
        '400':
          $ref: '#/components/responses/responses-BadRequest'
        '404':
          $ref: '#/components/responses/LoanNotFound'
      security:
        - oauth2:
            - rates:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Add loan rate cap
      tags:
        - Rate Caps
  /people/{personId}/loans/{loanId}/rate-caps/{rateCapId}:
    delete:
      description: >
        This endpoint is used for removing a single rate cap on a loan. 


        If a loan rate was capped at the `maxRate` and removing this rate 

        cap updates the effective interest rate, then we will replay the loan.
        If 

        a loan rate is not affected by the removal of this `maxRate`, 

        then we will not replay the loan. 
      operationId: peach.loans.rate_caps.handlers.loan_rate_cap_delete
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/rateCapId'
      responses:
        '200':
          $ref: '#/components/responses/RateCapDeleted'
        '404':
          $ref: '#/components/responses/RateCapNotFound'
      security:
        - oauth2:
            - rates:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete loan rate cap
      tags:
        - Rate Caps
    put:
      description: >
        This endpoint is used for updating a single rate cap on a loan.


        If a rate cap is updated on a loan for past periods and the 

        loan rate exceeds the cap, we will replay the loan to apply 

        the capped rate. If a rate cap is added for past periods and the loan 

        rate is not affected by the `maxRate` update, then we will not replay
        the loan. 
      operationId: peach.loans.rate_caps.handlers.loan_rate_cap_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/rateCapId'
      requestBody:
        $ref: '#/components/requestBodies/RateCapUpdate'
      responses:
        '200':
          $ref: '#/components/responses/RateCap'
        '400':
          $ref: '#/components/responses/responses-BadRequest'
        '404':
          $ref: '#/components/responses/RateCapNotFound'
      security:
        - oauth2:
            - rates:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update loan rate cap
      tags:
        - Rate Caps
  /people/{personId}/loans/{loanId}/rates:
    get:
      operationId: peach.people.loans.handlers.loan_rates_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      responses:
        '200':
          $ref: '#/components/responses/LoanRatesResponse'
      security:
        - oauth2:
            - rates:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan rates
      tags:
        - Rates
    post:
      description: >
        This endpoint is used for adding rates. A loan can have multiple rates.
        If two or more `interestRate`

        overlap on the same date we use the lowest value. If two or more
        `promoRate` overlap on the same date, we

        take the sum of the promo rates for the given day, and cap this rate at
        the maximum interest rate for the

        given day (to avoid accruing negative interest).


        The added `interestRate` will default to the existing interest type set
        on the loan at the time of

        origination (see `atOrigination.interestRate.interestType` attribute).

        The added `interestRate` must be within the bounds of any corresponding
        minimum and maximum rate range

        configuration that is found on the loan type (if any).
      operationId: peach.people.loans.handlers.loan_rates_add
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/LoanRateAdd'
      responses:
        '201':
          $ref: '#/components/responses/CreateOrUpdateInterestRatesResponse'
      security:
        - oauth2:
            - rates:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Add loan rate
      tags:
        - Rates
  /people/{personId}/loans/{loanId}/rates/{rateId}:
    delete:
      description: >
        This endpoint is used for removing a single `interest` or `promo` rate.
        The deletion of an

        interest rate cannot lead to a gap in the loan where there is no
        reference rate.


        Rates where setAtActivation is `true` can only be deleted with a special
        force permission.
      operationId: peach.people.loans.handlers.loan_rates_delete
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/rateId'
        - $ref: '#/components/parameters/caseFilter'
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - rates:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Remove loan rate
      tags:
        - Rates
    put:
      description: >
        This endpoint is used for updating a single `interest` or `promo` rate.
        (don't pass both in the same call). The updating of an

        interest rate cannot lead to a gap in the loan where there is no
        reference interest rate.
      operationId: peach.people.loans.handlers.loan_rates_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/rateId'
      requestBody:
        $ref: '#/components/requestBodies/LoanRateUpdate'
      responses:
        '200':
          $ref: '#/components/responses/CreateOrUpdateInterestRatesResponse'
      security:
        - oauth2:
            - rates:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update loan rate
      tags:
        - Rates
  /people/{personId}/loans/{loanId}/refresh:
    post:
      description: >
        In the case that a loan is out of sync, the refresh endpoint will make
        sure that

        obligations, expected payments, and interest accrual is brought into
        sync.


        Refresh loan is only valid for the statuses of `active`, `accelerate`,
        `paidOff`, and `chargedOff`.
      operationId: peach.people.loans.handlers.loan_refresh
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - loan:refresh
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Refresh loan
      tags:
        - Loans
  /people/{personId}/loans/{loanId}/refunds:
    get:
      description: >
        Returns a list of all prior refunds for the loan, as well as the
        remaining eligible refund amount.
      operationId: peach.people.loans.handlers.loan_refunds_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      responses:
        '200':
          $ref: '#/components/responses/LoanRefundCollection'
      security:
        - oauth2:
            - loan.refund:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get refunds
      tags:
        - Installment Refunds
    post:
      description: >
        The refund endpoint will execute a full or partial refund according to
        the `refundAmount` specified.

        A full refund is equal to the `amountFinancedAtOrigination`. An
        `atFaultParty` must also be specified,

        in order to trigger the corresponding accounting entries related to
        billing for the refund.
      operationId: peach.people.loans.handlers.loan_refunds_post
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/LoanRefund'
      responses:
        '200':
          $ref: '#/components/responses/LoanRefundPost'
      security:
        - oauth2:
            - loan.refund:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create refund
      tags:
        - Installment Refunds
  /people/{personId}/loans/{loanId}/refunds-v2:
    post:
      description: >
        The refund endpoint will execute a full or partial refund according to
        the `refundAmount` specified.

        The total of all refunds cannot exceed the `amountFinanced` (or
        `principalAmount`)  passed at origination.


        A refund is applied in the following way:

        - The system first depletes any non-due principal.
          This amount will be stored as `refundDetails.refundNonDuePrincipalAmount`.
        - If any refund amount is left to apply, the system will create a
        transaction of type service credit and `serviceCreditType=refund`.
          This transaction will be applied on the loan using the "payment waterfall".
          This amount will be stored as `refundDetails.refundTransactionAmount`.
        - After the system applies the `serviceCreditType=refund`, if there is
        any remaining unapplied
          refund amount, it will be recorded as credit to the borrower (also called `reimbursementAmount` or amount owed to borrower.)
        - The system will replay the loan from the `refundDate`.


        Please consider the following before creating refunds:


        - If you want to fully refund the loan including interest and fees, pass
        the following:
          - `refundDate` equals the activation date.
          - `refundAmount` equals the amount financed.
          - `isRefundOriginationFees`, `isRefundLateFees` and `isRefundOtherFees` set to `true`.
          - `isRefundMDR` and `isRefundDownPayment` - set these attributes depending on your policy.
        - If you want to partially refund the loan with prorated interest and/or
        fees, set the following. Prorated interest means
          the system will lower the principal from the activation date and re-accrue interest.
          - `refundDate` equals the activation date.
          - `refundAmount` equals a partial refund amount.
          - `isRefundOriginationFees`, `isRefundLateFees` and `isRefundOtherFees` - set these values depending on your policy.
          - `isRefundMDR` - set this attribute depending on your policy.
          - `isRefundDownPayment` - set to `false`. To remind: this attribute can be `true` only for a full refund.
        - If you want to partially refund the loan without prorating interest
        and/or fees prior the refund date, set the following:
          - `refundDate` equals an effective date of the refund (or keep empty to indicate "today").
          - `refundAmount` equals a partial refund amount.
          - `isRefundOriginationFees`, `isRefundLateFees` and `isRefundOtherFees` set to `false`.
          - `isRefundMDR` - set to `false`. To remind: this attribute can be `true` only if `refundDate` equals the activation date.
          - `isRefundDownPayment` - set to `false`. To remind: this attribute can be `true` only for a full refund.
      operationId: peach.people.loans.handlers.loan_refunds_v2_post
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/LoanRefundV2'
      responses:
        '200':
          $ref: '#/components/responses/LoanRefundV2Post'
      security:
        - oauth2:
            - loan.refund:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create refund v2
      tags:
        - Installment Refunds
  /people/{personId}/loans/{loanId}/refunds/{loanRefundId}/cancel:
    post:
      description: |
        Cancel a refund.
      operationId: peach.people.loans.handlers.loan_refunds_cancel
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/loanRefundId'
      requestBody:
        $ref: '#/components/requestBodies/LoanRefundCancel'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/LoanRefund'
                    type: object
          description: Loan Refund
      security:
        - oauth2:
            - loan.refund:cancel
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Cancel refund
      tags:
        - Installment Refunds
  /people/{personId}/loans/{loanId}/reimburse:
    post:
      description: >
        The reimburse endpoint should be used when the lender owes money to a
        borrower on a given loan.

        The endpoint will execute a reimbursement according to the specified
        `reimbursementAmount`. If the `reimbursementAmount` is greater than the
        amount owed to the borrower, the system will not process the
        reimbursement and return an error. Funds are reimbursed to a specified
        payment instrument. The endpoint will update the ledger and create a new
        transaction.


        If the loan type is installment, the loan must be in `paidOff` status to
        process reimbursement.

        If the loan type is line of credit, the loan can be in `active`,
        `accelerated`, `chargedOff` or `paidOff` status to process
        reimbursement.


        If `paymentInstrumentId` is `isExternal=true`, the payment method can be
        of any type (e.g. bank account, card, etc.)

        If `paymentInstrumentId` is `isExternal=false` and Peach is processing
        payments (per company configuration), the payment method must be a bank
        account.


        Please note for external reimbursements, the lender is responsible for
        transitioning the transaction status.
      operationId: peach.people.loans.handlers.loan_reimburse
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/LoanReimburse'
      responses:
        '201':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/Transaction'
                    type: object
          description: created
      security:
        - oauth2:
            - loan:reimburse
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Reimburse
      tags:
        - Loans
  /people/{personId}/loans/{loanId}/reopen:
    post:
      description: >
        Reopen a closed line of credit. This will allow new draws to be added.
        By default, draws in `paidOff` status will

        not be reopened, and a line of credit that has transitioned to `paidOff`
        status cannot be reopened. Set `force` to

        `true` to also reopen the line and all of its draws when they are
        `paidOff` (e.g. for a post-closure balance

        correction). No special permission is required beyond `loan:reopen`.
      operationId: peach.people.loans.handlers.loan_reopen
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                caseId:
                  description: An identifier for an existing case.
                  type: string
                force:
                  default: false
                  description: >
                    If `true`, reopen the line of credit and all of its draws
                    even when they are in `paidOff` status.
                  type: boolean
                reopenReason:
                  description: The reason the loan is being reopened.
                  type: string
              type: object
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - loan:reopen
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Reopen a closed loan
      tags:
        - Loans
  /people/{personId}/loans/{loanId}/reverse-accelerate:
    post:
      description: >
        A loan must be in `accelerated` status to be reversed.


        The reverse accelerate endpoint will reverse a loan in `accelerated`
        status, and roll back any acceleration-related

        logic and accounting treatment.


        Reverse acceleration triggers a replay of the loan starting from the day
        of acceleration as if the loan was in `active`

        status. This means if the acceleration occurred on day 90 of the loan,
        and the reverse acceleration is triggered on day

        100, the loan will be replayed as an `active` loan with interest accrual
        between days 90-100. If the reversal is

        triggered on day 90 (the same day of the acceleration), no additional
        interest is accrued. The result of a reverse

        acceleration is a loan in `active` status.


        The `accelerationDueWithin` and `chargeOffDueWithin` configurations of
        the loan are still in force. So a loan could

        possibly go back to `accelerated` or `chargedOff` status during the next
        day if the balance is not paid on the day a

        reversal was made.
      operationId: peach.people.loans.handlers.loan_accelerate_reverse
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/CaseId'
      responses:
        '200':
          $ref: '#/components/responses/LoanReverseAccelerate'
      security:
        - oauth2:
            - loan:accelerate.reverse
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Reverse accelerate
      tags:
        - Loans
  /people/{personId}/loans/{loanId}/reverse-charge-off:
    post:
      description: >
        A loan must be in `chargedOff` status to be reversed.


        The reverse charge-off endpoint will reverse a loan in `chargedOff`
        status, and roll back any charge-off-related logic

        and accounting treatment.


        Reverse charge-off triggers a replay of the loan starting from the day
        of charge off as if the loan was in `active`

        status. This means if the charge-off occurred on day 120 of the loan,
        and the reverse charge-off is triggered on day

        130, the loan will be replayed as an `active` loan with interest accrual
        between days 120-130. If the reversal is

        triggered on day 120 (the same day of the charge-off), no additional
        interest is accrued. The result of a reverse

        charge-off is a loan in `active` status.


        The `chargeOffDueWithin` configurations of the loan is still in force.
        So a loan could possibly go back to `chargedOff`

        status during the next day if the balance is not paid on the day a
        reversal was made.
      operationId: peach.people.loans.handlers.loan_charge_off_reverse
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/CaseId'
      responses:
        '200':
          $ref: '#/components/responses/LoanReverseChargeOff'
      security:
        - oauth2:
            - loan:chargeoff.reverse
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Reverse charge-off
      tags:
        - Loans
  /people/{personId}/loans/{loanId}/schedule-options:
    get:
      description: >
        Internal endpoint used by the front end to get relevant information for
        loan schedule changes
      operationId: peach.people.loans.handlers.loan_schedule_options_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - description: >-
            If True, will return due date options for autopay (does not respect
            min due date buffer)
          in: query
          name: isAutopay
          required: false
          schema:
            default: false
            type: boolean
      responses:
        '200':
          $ref: '#/components/responses/LoanScheduleOptions'
      security:
        - oauth2:
            - loan.scheduleoptions:get
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get loan schedule options
  /people/{personId}/loans/{loanId}/statements:
    get:
      operationId: peach.statements.handlers.get_statements
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/sortBy'
        - $ref: '#/components/parameters/statementYear'
        - $ref: '#/components/parameters/includeAllVersions'
        - $ref: '#/components/parameters/includeTestVersions'
        - description: List of document descriptor IDs to filter by
          in: query
          name: documentDescriptorIds
          required: false
          schema:
            items:
              $ref: '#/components/schemas/AnyId'
            type: array
      responses:
        '200':
          $ref: '#/components/responses/StatementCollection'
      security:
        - oauth2:
            - statement:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get statements
      tags:
        - Statements
  /people/{personId}/loans/{loanId}/statements/{statementId}:
    put:
      operationId: peach.statements.handlers.update_statement
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/statementPubId'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                documentDescriptorId:
                  description: >
                    Identifier for the document descriptor to be attached to the
                    statement.

                    This value can only be updated if `isCreateAndSendPDF` is
                    set to false on the loan type configuration,

                    OR the statement was created via LOC migration
                    (`isExternal=true`).
                  type: string
              required:
                - documentDescriptorId
              type: object
        required: true
      responses:
        '200':
          $ref: '#/components/responses/Statement'
      security:
        - oauth2:
            - statement:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update statement
      tags:
        - Statements
  /people/{personId}/loans/{loanId}/statements/{statementId}/details:
    get:
      operationId: peach.statements.handlers.get_statement_details
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/statementPubId'
      responses:
        '200':
          $ref: '#/components/responses/StatementDetails'
      security:
        - oauth2:
            - statement:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get statement details
      tags:
        - Statements
  /people/{personId}/loans/{loanId}/transactions:
    get:
      operationId: peach.transactions.handlers.loan_transactions_get_all
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/transactionStatuses'
        - $ref: '#/components/parameters/queryPaymentInstrumentId'
        - $ref: '#/components/parameters/parameters_isExternal'
        - $ref: '#/components/parameters/isVirtual'
        - $ref: '#/components/parameters/transactionType'
        - $ref: '#/components/parameters/paymentReason'
        - $ref: '#/components/parameters/retryOriginalTransactionId'
        - $ref: '#/components/parameters/serviceCreditTypes'
        - $ref: '#/components/parameters/toEffectiveDateGeneric'
        - $ref: '#/components/parameters/fromEffectiveDateGeneric'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/sortByForTransactions'
      responses:
        '200':
          $ref: '#/components/responses/TransactionCollection'
      security:
        - oauth2:
            - transaction:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get transactions
      tags:
        - Transactions
    post:
      description: >
        Create a transaction. Permissions required depend on the object type
        passed:


        | type             | permission                            |

        |------------------|---------------------------------------|

        | One Time Payment | `transaction:create.onetimepayment`   |

        | Service Credit   | `transaction:create.servicecredit`    |

        | Down Payment     | `transaction:create.downpayment`      |


        Once a loan has been onboarded to Peach's platform, valid loan statuses
        for each transaction type are as follows:


        | type             | valid loan statuses                       |

        |------------------|-------------------------------------------|

        | One Time Payment | `active`, `accelerated`, or `chargedOff`* |

        | Service Credit   | `active`, `accelerated`, or `chargedOff`* |

        | Down Payment     | `active`                                  |


        *=`chargedOff` is only valid when the loan type configuration
        `paymentAllowedWhenChargedOff` is `true`.


        During migration while a loan is in `prepMigration`, valid loan statuses
        for each transaction type are as follows:


        | type             | valid loan statuses                      |

        |------------------|------------------------------------------|

        | One Time Payment | `originated`                             |

        | Service Credit   | `originated`                             |

        | Down Payment     | `active`                                 |
      operationId: peach.transactions.handlers.transactions_create
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/syncGeneric'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTransaction'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/Transaction'
                    type: object
          description: Created
        '408':
          description: Request Timeout
        '423':
          $ref: '#/components/responses/LockedResponse'
      security:
        - oauth2:
            - transaction:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create transaction
      tags:
        - Transactions
  /people/{personId}/loans/{loanId}/transactions/fail:
    post:
      description: >
        This endpoint allows you to fail multiple transactions in one call. The
        system will mark applicable transactions as 

        `failed` and replay the loan once (starting from the earliest effective
        date of the provided transactions).
      operationId: peach.transactions.handlers.transactions_fail_multiple
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/syncGeneric'
      requestBody:
        $ref: '#/components/requestBodies/FailMultipleTransactions'
      responses:
        '200':
          $ref: '#/components/responses/FailMultipleTransactions'
      security:
        - oauth2:
            - transaction:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Fail multiple transactions
      tags:
        - Transactions
  /people/{personId}/loans/{loanId}/transactions/{transactionId}:
    get:
      operationId: peach.transactions.handlers.transactions_get_by_id
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/transactionId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/Transaction'
                    type: object
          description: success
      security:
        - oauth2:
            - transaction:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get transaction by ID
      tags:
        - Transactions
    put:
      operationId: peach.transactions.handlers.transactions_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/transactionId'
        - $ref: '#/components/parameters/syncGeneric'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionUpdateExternal'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/Transaction'
                    type: object
          description: Updated
        '408':
          description: Request Timeout
      security:
        - oauth2:
            - transaction:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update transaction
      tags:
        - Transactions
  /people/{personId}/loans/{loanId}/transactions/{transactionId}/backdate:
    post:
      description: >-
        Backdate a transaction. Can only be applied to transactions with
        `status=succeeded` or `status=pending`. Can be applied to payments or
        service credits.
      operationId: peach.transactions.handlers.transaction_backdate
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/transactionId'
        - $ref: '#/components/parameters/syncGeneric'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                caseId:
                  description: The identifier of an existing case.
                  type: string
                effectiveDate:
                  description: New effective date for the transaction.
                  format: date
                  type: string
                effectiveTimeOfDay:
                  allOf:
                    - $ref: '#/components/schemas/TimeOfDay'
                    - description: >
                        The effective time of day on effectiveDate in the
                        product timezone. If the time of day is not provided,
                        the Peach system will set the time of

                        day based on the following logic:


                        - If backdated to the loan activation date, the system
                        will set the timestamp to the activation timestamp plus
                        a few seconds.

                        - If backdated to a loan non-activation date, the system
                        will set the timestamp to a few minutes after the loan
                        accrued interest on the effectiveDate.
                      type: object
              required:
                - effectiveDate
              type: object
        required: true
      responses:
        '200':
          description: Backdated
        '408':
          description: Request Timeout
        '423':
          $ref: '#/components/responses/LockedResponse'
      security:
        - oauth2:
            - transaction:backdate
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Backdate transaction
      tags:
        - Transactions
  /people/{personId}/loans/{loanId}/transactions/{transactionId}/cancel:
    post:
      operationId: peach.transactions.handlers.transaction_cancel
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/transactionId'
        - $ref: '#/components/parameters/transactionCancelReason'
        - $ref: '#/components/parameters/clearExternalIdGeneric'
      responses:
        '204':
          description: canceled
      security:
        - oauth2:
            - transaction:cancel
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Cancel transaction
      tags:
        - Transactions
  /people/{personId}/loans/{loanId}/transactions/{transactionId}/chargebacks:
    get:
      operationId: peach.transactions.chargebacks.handlers.get_chargebacks
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/transactionId'
      responses:
        '200':
          $ref: '#/components/responses/Chargebacks'
      security:
        - oauth2:
            - transaction:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get transaction chargebacks
      tags:
        - Transactions
    post:
      description: >
        In some cases a borrower might chargeback/dispute a payment that they
        made in the past. Only transactions in `succeeded` status can be charged
        back.


        If the payment/transaction `isExternal=true`, the caller can post
        chargeback in two ways:
         1. Update status of the transaction to `inDispute` or `chargeback` directly. The chargeback amount defaults to the full amount of the transaction.
            The system will create a chargeback object automatically. This option is the easiest way to tell the system about a chargeback.
         1. Create chargeback(s) via `Create transaction chargeback` endpoint. This option allows the caller to provide more details about the chargeback.
            This option should be used for multiple partial chargebacks. Keep in mind that a transaction can have multiple chargebacks and reversals.

        It's important to not mix the options above because it can create edge
        cases and confusion.


        If the payment/transaction is `isExternal=false`, the caller cannot
        change the transaction status to `inDispute` or `chargeback` nor create
        chargeback(s)

        via `Create transaction chargeback` endpoint. Chargebacks will be
        received directly from the payment processor.
      operationId: peach.transactions.chargebacks.handlers.transaction_chargeback
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/transactionId'
        - $ref: '#/components/parameters/syncGeneric'
      requestBody:
        $ref: '#/components/requestBodies/ChargebackPost'
      responses:
        '201':
          $ref: '#/components/responses/Chargeback'
        '408':
          description: Request Timeout
      security:
        - oauth2:
            - transaction:chargeback
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create transaction chargeback
      tags:
        - Transactions
  /people/{personId}/loans/{loanId}/transactions/{transactionId}/chargebacks/{chargebackId}:
    get:
      operationId: peach.transactions.chargebacks.handlers.get_chargeback_by_id
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/transactionId'
        - $ref: '#/components/parameters/chargebackId'
      responses:
        '200':
          $ref: '#/components/responses/Chargeback'
      security:
        - oauth2:
            - transaction:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get chargeback by ID
      tags:
        - Transactions
    put:
      operationId: peach.transactions.chargebacks.handlers.update_chargeback
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/transactionId'
        - $ref: '#/components/parameters/chargebackId'
        - $ref: '#/components/parameters/syncGeneric'
      requestBody:
        $ref: '#/components/requestBodies/ChargebackPut'
      responses:
        '200':
          $ref: '#/components/responses/Chargeback'
      security:
        - oauth2:
            - transaction:chargeback
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update chargeback
      tags:
        - Transactions
  /people/{personId}/loans/{loanId}/transactions/{transactionId}/reverse:
    post:
      operationId: peach.transactions.handlers.transaction_reverse
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
        - $ref: '#/components/parameters/transactionId'
        - $ref: '#/components/parameters/syncGeneric'
      requestBody:
        $ref: '#/components/requestBodies/ReversalPost'
      responses:
        '201':
          $ref: '#/components/responses/Transaction'
        '408':
          description: Request Timeout
        '423':
          $ref: '#/components/responses/LockedResponse'
      security:
        - oauth2:
            - transaction:reverse
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Reverse transaction
      tags:
        - Transactions
  /people/{personId}/loans/{loanId}/unfreeze:
    post:
      description: >
        The Unfreeze endpoint will change the status of a `frozen` loan back to
        `active`, `accelerated` or `chargedOff`.


        If the account was overdue before it was frozen, the system will use the
        earliest overdue due date (before the freeze date)

        to count the number of days overdue and might accelerate or charge off
        the account (based on the loan type configurations) as

        part of the unfreeze process. After the unfreeze process is completed,
        you can reverse the chargedOff status and take

        additional actions such as posting a payment to make the account
        current.
      operationId: peach.people.loans.handlers.loan_unfreeze
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/loanId'
      requestBody:
        $ref: '#/components/requestBodies/LoanUnfreeze'
      responses:
        '200':
          $ref: '#/components/responses/ExpectedPayments'
        '423':
          $ref: '#/components/responses/LockedResponse'
      security:
        - oauth2:
            - loan:unfreeze
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Unfreeze loan
      tags:
        - Loans
  /people/{personId}/notes:
    get:
      operationId: peach.notes.handlers.list_borrower_notes
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/noteCategories'
        - $ref: '#/components/parameters/sortBy'
        - description: Include archived notes into the result
          in: query
          name: includeArchived
          required: false
          schema:
            default: false
            type: boolean
        - $ref: '#/components/parameters/notePinned'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/NewPaginator'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/NoteResponse'
                        type: array
                    type: object
          description: OK
      security:
        - oauth2:
            - note:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get notes
      tags:
        - Notes
    post:
      operationId: peach.notes.handlers.create_borrower_note
      parameters:
        - $ref: '#/components/parameters/personId'
      requestBody:
        $ref: '#/components/requestBodies/Note'
      responses:
        '200':
          $ref: '#/components/responses/Note'
      security:
        - oauth2:
            - note:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create note
      tags:
        - Notes
  /people/{personId}/notes/{noteId}:
    get:
      operationId: peach.notes.handlers.get_borrower_note
      parameters:
        - $ref: '#/components/parameters/personId'
        - description: The note identifier.
          in: path
          name: noteId
          required: true
          schema:
            type: string
      responses:
        '200':
          $ref: '#/components/responses/Note'
      security:
        - oauth2:
            - note:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get note by ID
      tags:
        - Notes
    put:
      operationId: peach.notes.handlers.update_borrower_note
      parameters:
        - $ref: '#/components/parameters/personId'
        - description: The note identifier.
          in: path
          name: noteId
          required: true
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/Note'
      responses:
        '200':
          $ref: '#/components/responses/Note'
      security:
        - oauth2:
            - note:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update note
      tags:
        - Notes
  /people/{personId}/payment-instruments:
    get:
      operationId: peach.payment_instruments.handlers.person_payment_instrument_get_all
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/parameters_isExternal'
        - $ref: '#/components/parameters/parameters_includeDeleted'
        - $ref: '#/components/parameters/showFullAccountNumber'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Paging'
                  - properties:
                      count:
                        format: int32
                        type: integer
                      data:
                        items:
                          $ref: '#/components/schemas/PaymentInstrumentGet'
                        type: array
                    required:
                      - count
                      - data
                    type: object
                title: Payment Instruments
          description: Payment Instruments
      security:
        - oauth2:
            - payment.instrument:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get payment instruments
      tags:
        - Payment Instruments
    post:
      description: >
        Create a payment instrument.


        When creating a payment instrument using the Plaid Account option, two
        flows are supported:


        1) Pass only `accessToken` and `accountIds`. This will create a payment
        instrument with `status`=`inactive`.

        You can then use <a
        href="./payment-instruments/peach.payment_instruments.handlers.person_payment_instrument_update">Update
        payment instrument</a>

        endpoint to set the `accountHolderType`, and `accountHolderName` fields,
        and set the `status` to `active`.


        2) Pass the required fields as well as `accountHolderType`, and
        `accountHolderName`. This will create a payment

        instrument with `status`=`active`. The payment instrument will then be
        ready to use.


        *Note: This endpoint returns an array containing a single payment
        instrument to allow future support for Plaid multi-account select.*
      operationId: peach.payment_instruments.handlers.person_payment_instrument_create
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/forcePaymentInstrument'
        - $ref: '#/components/parameters/sync'
        - $ref: '#/components/parameters/allowDuplicates'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentInstrumentPost'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Paging'
                  - properties:
                      count:
                        format: int32
                        type: integer
                      data:
                        items:
                          $ref: '#/components/schemas/PaymentInstrument'
                        type: array
                    required:
                      - count
                      - data
                    type: object
                title: Payment Instruments
          description: Payment Instruments
        '409':
          description: Duplicate instrument
      security:
        - oauth2:
            - payment.instrument:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create payment instrument
      tags:
        - Payment Instruments
  /people/{personId}/payment-instruments/{paymentInstrumentId}:
    delete:
      operationId: peach.payment_instruments.handlers.person_payment_instrument_delete
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/paymentInstrumentId'
      responses:
        '204':
          description: Payment Instrument Deleted
      security:
        - oauth2:
            - payment.instrument:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete payment instrument
      tags:
        - Payment Instruments
    get:
      operationId: peach.payment_instruments.handlers.person_payment_instrument_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/paymentInstrumentId'
        - $ref: '#/components/parameters/showFullAccountNumber'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/PaymentInstrumentGet'
                    type: object
          description: Payment Instrument
      security:
        - oauth2:
            - payment.instrument:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get payment instrument by ID
      tags:
        - Payment Instruments
    put:
      operationId: peach.payment_instruments.handlers.person_payment_instrument_update
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/paymentInstrumentId'
        - $ref: '#/components/parameters/sync'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/PaymentInstrumentMutable'
        required: true
      responses:
        '204':
          description: Payment Instrument Updated
      security:
        - oauth2:
            - payment.instrument:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update payment instrument
      tags:
        - Payment Instruments
  /people/{personId}/payment-instruments/{paymentInstrumentId}/account-link:
    delete:
      description: Retrieve the data vendor link details for this payment instrument.
      operationId: peach.payment_instruments.handlers.account_link_delete
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/paymentInstrumentId'
      responses:
        '204':
          description: Deleted
      security:
        - oauth2:
            - payment.instrument:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete account link
      tags:
        - Payment Instruments
    post:
      description: >-
        Add a data vendor link for this payment instrument. If one is already
        present, it is replaced.
      operationId: peach.payment_instruments.handlers.account_link_post
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/paymentInstrumentId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountLink'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/AccountLink'
                    type: object
          description: Account Link created
      security:
        - oauth2:
            - payment.instrument:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create account link
      tags:
        - Payment Instruments
    put:
      description: >-
        Update record keeping details about the account link. This can not be
        used to set up a new account link.
      operationId: peach.payment_instruments.handlers.account_link_put
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/paymentInstrumentId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountLinkUpdate'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/AccountLink'
                    type: object
          description: Account Link updated
      security:
        - oauth2:
            - payment.instrument:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update account link
      tags:
        - Payment Instruments
  /people/{personId}/payment-instruments/{paymentInstrumentId}/balance:
    get:
      description: >-
        Get stored balance data for the account associated with the payment
        instrument.
      operationId: peach.payment_instruments.handlers.balances_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/paymentInstrumentId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/AccountLinkBalanceEntry'
                    type: object
          description: Success
      security:
        - oauth2:
            - payment.instrument:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get balance data
      tags:
        - Payment Instruments
    post:
      description: >-
        Fetch updated balance data from the account link associated with this
        payment instrument.
      operationId: peach.payment_instruments.handlers.balances_post
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/paymentInstrumentId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/AccountLinkBalanceEntry'
                    type: object
          description: Success
      security:
        - oauth2:
            - payment.instrument:update.balances
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Refresh balance data
      tags:
        - Payment Instruments
  /people/{personId}/payment-instruments/{paymentInstrumentId}/verify:
    post:
      operationId: peach.payment_instruments.handlers.person_payment_instrument_verify
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/paymentInstrumentId'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                deposit1:
                  type: integer
                deposit2:
                  type: integer
              required:
                - deposit1
                - deposit2
              type: object
        required: true
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - payment.instrument:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Verify amounts of microdeposits
      tags:
        - Payment Instruments
  /people/{personId}/verifications:
    get:
      description: >
        Retrieve all verifications—optionally filtering. Note that unlike most
        Peach "get all" endpoints,

        the verifications get all endpoint returns items in a reverse
        chronological list, since almost

        all interesting verifications are those which happened in the recent
        past.
      operationId: >-
        peach.people.borrower_verification.handlers.borrower_verification_get_all
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/verificationStatus'
      responses:
        '200':
          $ref: '#/components/responses/VerificationsPaging'
      security:
        - oauth2:
            - verification:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get verifications
      tags:
        - Verifications
    post:
      description: >
        Start a borrower verification session. Newly created verifications

        include randomly selected questions about the borrower. The human must
        attempt

        to provide correct answers to these questions in order for the borrower
        verification

        to be successful.


        To check if a verification can be started now without actually starting
        a verification,

        add the query parameter `dryRun=true` to the URL. If a verification
        could be started now

        return successful (`204`), otherwise return an error response with

        `nextVerificationOkAt` indicating when the next verification can start.
      operationId: peach.people.borrower_verification.handlers.borrower_verification_create
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/dryRun'
      requestBody:
        $ref: '#/components/requestBodies/VerificationPost'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/Verification'
                    type: object
          description: Successfully started verification
        '204':
          description: >-
            A verification can be started now—only occurs with `dryRun=true`
            parameter
        '400':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      message:
                        description: A description of the error.
                        type: string
                    type: object
          description: A verification is not possible
        '429':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        properties:
                          nextVerificationOkAt:
                            format: date-time
                            type: string
                        type: object
                    type: object
          description: A verification cannot be started now—try again later
      security:
        - oauth2:
            - verification:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Start verification
      tags:
        - Verifications
  /people/{personId}/verifications/{verificationId}:
    get:
      operationId: peach.people.borrower_verification.handlers.borrower_verification_get
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/verificationId'
      responses:
        '200':
          $ref: '#/components/responses/Verification'
      security:
        - oauth2:
            - verification:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get verification by ID
      tags:
        - Verifications
  /people/{personId}/verifications/{verificationId}/attempts:
    post:
      operationId: >-
        peach.people.borrower_verification.handlers.borrower_verification_answer_attempt_create
      parameters:
        - $ref: '#/components/parameters/personId'
        - $ref: '#/components/parameters/verificationId'
      requestBody:
        $ref: '#/components/requestBodies/VerificationAttemptPost'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/VerificationAttempt'
                    type: object
          description: Created
      security:
        - oauth2:
            - verification:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Answer verification questions
      tags:
        - Verifications
  /promise-to-pay-plans:
    get:
      description: Returns `Promise to Pay Plan`s for a given company.
      operationId: peach.loans.promise_to_pays.handlers.get_promise_to_pay_plans_by_company
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/parameters-status'
        - $ref: '#/components/parameters/isOverdue'
        - $ref: '#/components/parameters/startDateAfter'
        - $ref: '#/components/parameters/endDateBefore'
      responses:
        '200':
          $ref: '#/components/responses/PromisetoPayPlansPaging'
      security:
        - oauth2:
            - promise.to.pay.plan:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get Promise to Pay Plans for a company
      tags:
        - Promise to Pay Plans
  /routing-numbers/{routingNumber}:
    get:
      operationId: peach.routing_numbers.handlers.get_routing_number
      parameters:
        - description: The routing number. Routing number's length is 9 digits.
          in: path
          name: routingNumber
          required: true
          schema:
            pattern: \d{9}
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        properties:
                          bankName:
                            description: The financial institution name.
                            example: PEACH BANK AND TRUST
                            type: string
                          lastUpdatedDate:
                            description: >
                              Peach system receives a list of valid routing
                              numbers published by the Federal Reserve Bank once
                              or twice a month.

                              This is the date when Peach received the latest
                              update.
                            type: string
                          routingNumber:
                            description: >
                              The routing number. If the institution has
                              received a new routing number from The Fed,

                              this may differ from the input routing number.
                              Otherwise, it will match to the input routing
                              number.
                            example: 12345678
                            type: string
                        type: object
                    type: object
          description: Bank Details
        '404':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        properties:
                          lastUpdatedDate:
                            description: >
                              Peach system receives a list of valid routing
                              numbers published by the Federal Reserve Bank once
                              or twice a month.

                              This is the date when Peach received the latest
                              update.
                            type: string
                        type: object
                    type: object
          description: Not found
      security:
        - oauth2:
            - routing.numbers:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get routing number details
      tags:
        - Routing Numbers
  /supercases:
    get:
      operationId: peach.supercases.handlers.supercase_list
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/supercaseSortBy'
        - $ref: '#/components/parameters/supercaseType'
        - $ref: '#/components/parameters/femaDisasterNumber'
        - $ref: '#/components/parameters/statusFilter'
      responses:
        '200':
          $ref: '#/components/responses/SupercasePagingResponse'
      security:
        - oauth2:
            - supercase:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: List supercases
      tags:
        - Supercases
    post:
      description: Creates a new supercase.
      operationId: peach.supercases.handlers.supercase_create
      requestBody:
        $ref: '#/components/requestBodies/SupercasePost'
      responses:
        '200':
          $ref: '#/components/responses/SupercaseResponse'
      security:
        - oauth2:
            - supercase:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create supercase
      tags:
        - Supercases
  /supercases/members-template.csv:
    get:
      operationId: peach.supercases.handlers.supercase_members_template_csv
      responses:
        '200':
          content:
            text/csv:
              schema:
                format: binary
                type: string
          description: Success
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get supercase members.csv template
      tags:
        - Supercases
  /supercases/{supercaseId}:
    get:
      operationId: peach.supercases.handlers.supercase_get
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
      responses:
        '200':
          $ref: '#/components/responses/SupercaseResponse'
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get supercase by ID
      tags:
        - Supercases
    put:
      operationId: peach.supercases.handlers.supercase_update
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
      requestBody:
        $ref: '#/components/requestBodies/SupercasePut'
      responses:
        '200':
          $ref: '#/components/responses/SupercaseResponse'
      security:
        - oauth2:
            - supercase:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update supercase
      tags:
        - Supercases
  /supercases/{supercaseId}/bulk-create-do-not-interact:
    post:
      operationId: peach.supercases.handlers.supercase_bulk_create_dni
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
      requestBody:
        $ref: '#/components/requestBodies/DoNotInteractCreate'
      responses:
        '202':
          $ref: '#/components/responses/BulkOperationResponse'
      security:
        - oauth2:
            - supercase:bulk.create.dni
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create Do Not Interact instances on all subcases
      tags:
        - Supercases
  /supercases/{supercaseId}/bulk-delete-do-not-interact:
    post:
      operationId: peach.supercases.handlers.supercase_bulk_delete_dni
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
      responses:
        '202':
          $ref: '#/components/responses/BulkOperationResponse'
      security:
        - oauth2:
            - supercase:bulk.delete.dni
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete supercase related Do Not Interact instances on all subcases
      tags:
        - Supercases
  /supercases/{supercaseId}/bulk-operations:
    get:
      operationId: peach.supercases.handlers.supercase_bulk_operation_list
      parameters:
        - $ref: '#/components/parameters/searchable'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/sortBy'
        - $ref: '#/components/parameters/components-parameters-supercaseId'
        - $ref: '#/components/parameters/operationTypes'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/NewPaginator'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/SupercaseBulkOperation'
                        type: array
                    type: object
          description: OK
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: List bulk operations on this supercase
      tags:
        - Supercases
  /supercases/{supercaseId}/bulk-operations/search:
    get:
      operationId: peach.supercases.handlers.supercase_bulk_operation_search
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/SupercaseBulkOperation'
                        type: array
                    type: object
          description: OK
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Search bulk operations on this supercase
      tags:
        - Supercases
  /supercases/{supercaseId}/bulk-operations/{supercaseBulkOperationId}:
    get:
      operationId: peach.supercases.handlers.supercase_bulk_operation_get
      parameters:
        - $ref: '#/components/parameters/searchable'
        - $ref: '#/components/parameters/components-parameters-supercaseId'
        - $ref: '#/components/parameters/supercaseBulkOperationId'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SupercaseBulkOperation'
          description: OK
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get supercase bulk operation by ID
      tags:
        - Supercases
  /supercases/{supercaseId}/bulk-operations/{supercaseBulkOperationId}/member-bulk-operation-results:
    get:
      description: >
        Returns a list of member bulk operation results for the supercase bulk
        operation. Each member bulk operation result represents a member that
        was affected by the operation.
      operationId: peach.supercases.handlers.get_member_bulk_operation_results_by_operation
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
        - $ref: '#/components/parameters/supercaseBulkOperationId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/sortBy'
        - description: >
            Filter by status. Possible values are success, failed, ineligible,
            notProcessed.
          in: query
          name: status
          required: false
          schema:
            enum:
              - success
              - failed
              - ineligible
              - notProcessed
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Paging'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/MemberBulkOperationResult'
                        type: array
                    type: object
          description: OK
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get member bulk operation results by operation
      tags:
        - Supercases
  /supercases/{supercaseId}/bulk-operations/{supercaseBulkOperationId}/target-populations:
    get:
      description: >
        Returns a list of target populations for the supercase bulk operation.
        Each target population represents a set of members that will be affected
        by the operation.
      operationId: peach.supercases.handlers.get_bulk_operation_target_populations
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
        - $ref: '#/components/parameters/supercaseBulkOperationId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/sortBy'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Paging'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/TargetPopulation'
                        type: array
                    type: object
          description: OK
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get target populations for the supercase bulk operation
      tags:
        - Supercases
  /supercases/{supercaseId}/bulk-send:
    post:
      operationId: peach.supercases.handlers.supercase_bulk_send_message
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
      requestBody:
        $ref: '#/components/requestBodies/BulkSendRequestBody'
      responses:
        '202':
          $ref: '#/components/responses/BulkOperationResponse'
      security:
        - oauth2:
            - supercase:bulk.send
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Send a message to the borrowers on all subcases
      tags:
        - Supercases
  /supercases/{supercaseId}/bulk-update:
    post:
      operationId: peach.supercases.handlers.supercase_bulk_update
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
      requestBody:
        $ref: '#/components/requestBodies/CasePut'
      responses:
        '202':
          $ref: '#/components/responses/BulkOperationResponse'
      security:
        - oauth2:
            - supercase:bulk.update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update all subcases
      tags:
        - Supercases
  /supercases/{supercaseId}/case-count:
    get:
      operationId: peach.supercases.handlers.supercase_case_count
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        properties:
                          caseCount:
                            description: The number of cases associated with the supercase
                            type: integer
                        type: object
                    type: object
          description: OK
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get the number of cases associated with the supercase
      tags:
        - Supercases
  /supercases/{supercaseId}/documents:
    get:
      operationId: peach.supercases.handlers.documents.get_supercase_documents
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
        - description: >
            If `true`, returns a list of document objects, if `false` - a list
            of document IDs.
          in: query
          name: fetchDetails
          schema:
            default: false
            type: boolean
      responses:
        '200':
          $ref: '#/components/responses/SupercaseDocumentsResponse'
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get the list of supercase documents
      tags:
        - Supercases
    post:
      operationId: peach.supercases.handlers.documents.add_supercase_documents
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
      requestBody:
        $ref: '#/components/requestBodies/SupercaseDocumentList'
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - supercase:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Associate documents with the supercase
      tags:
        - Supercases
    put:
      operationId: peach.supercases.handlers.documents.set_supercase_documents
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
      requestBody:
        $ref: '#/components/requestBodies/SupercaseDocumentList'
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - supercase:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Set the documents associated with the supercase
      tags:
        - Supercases
  /supercases/{supercaseId}/global-notes:
    get:
      operationId: peach.supercases.handlers.notes.global_note_list
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/limit'
        - description: Include archived notes into the result
          in: query
          name: includeArchived
          required: false
          schema:
            default: false
            type: boolean
        - $ref: '#/components/parameters/notePinned'
        - $ref: '#/components/parameters/sortBy'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/NewPaginator'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/NoteResponse'
                        type: array
                    type: object
          description: OK
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get global notes
      tags:
        - Supercases
    post:
      operationId: peach.supercases.handlers.notes.global_note_create
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
      requestBody:
        $ref: '#/components/requestBodies/Note'
      responses:
        '200':
          $ref: '#/components/responses/Note'
      security:
        - oauth2:
            - supercase:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create global note
      tags:
        - Supercases
  /supercases/{supercaseId}/global-notes/{noteId}:
    get:
      operationId: peach.supercases.handlers.notes.global_note_get
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
        - $ref: '#/components/parameters/noteId'
      responses:
        '200':
          $ref: '#/components/responses/Note'
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get global note by ID
      tags:
        - Supercases
    put:
      operationId: peach.supercases.handlers.notes.global_note_update
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
        - $ref: '#/components/parameters/noteId'
      requestBody:
        $ref: '#/components/requestBodies/Note'
      responses:
        '200':
          $ref: '#/components/responses/Note'
      security:
        - oauth2:
            - supercase:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update global note
      tags:
        - Supercases
  /supercases/{supercaseId}/notes:
    get:
      operationId: peach.supercases.handlers.notes.private_note_list
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/components-parameters-supercaseId'
        - description: Include archived notes into the result
          in: query
          name: includeArchived
          required: false
          schema:
            default: false
            type: boolean
        - $ref: '#/components/parameters/notePinned'
        - $ref: '#/components/parameters/sortBy'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/NewPaginator'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/NoteResponse'
                        type: array
                    type: object
          description: OK
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get private notes
      tags:
        - Supercases
    post:
      operationId: peach.supercases.handlers.notes.private_note_create
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
      requestBody:
        $ref: '#/components/requestBodies/Note'
      responses:
        '200':
          $ref: '#/components/responses/Note'
      security:
        - oauth2:
            - supercase:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create private note
      tags:
        - Supercases
  /supercases/{supercaseId}/notes/{noteId}:
    get:
      operationId: peach.supercases.handlers.notes.private_note_get
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
        - $ref: '#/components/parameters/noteId'
      responses:
        '200':
          $ref: '#/components/responses/Note'
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get private note by ID
      tags:
        - Supercases
    put:
      operationId: peach.supercases.handlers.notes.private_note_update
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
        - $ref: '#/components/parameters/noteId'
      requestBody:
        $ref: '#/components/requestBodies/Note'
      responses:
        '200':
          $ref: '#/components/responses/Note'
      security:
        - oauth2:
            - supercase:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update private note
      tags:
        - Supercases
  /supercases/{supercaseId}/populations:
    get:
      operationId: peach.supercases.handlers.population_list
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
      responses:
        '200':
          $ref: '#/components/responses/PopulationPagingResponse'
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: List populations
      tags:
        - Supercases
  /supercases/{supercaseId}/populations/draft:
    get:
      operationId: peach.supercases.handlers.draft_population_get
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
      responses:
        '200':
          $ref: '#/components/responses/PopulationResponse'
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get draft population
      tags:
        - Supercases
  /supercases/{supercaseId}/populations/draft/commit:
    post:
      description: >
        Creates subcases for all members of the draft population and moves the
        population to the committed state.
      operationId: peach.supercases.handlers.draft_population_commit
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - supercase:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Commit draft population
      tags:
        - Supercases
  /supercases/{supercaseId}/populations/draft/members:
    get:
      operationId: peach.supercases.handlers.draft_population_members_list
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
      responses:
        '200':
          $ref: '#/components/responses/PopulationMemberCollectionResponse'
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get the draft population members
      tags:
        - Supercases
    post:
      description: |
        Add to the current population membership the members in this request.
      operationId: peach.supercases.handlers.draft_population_members_add
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
        - $ref: '#/components/parameters/publishReviewTask'
      requestBody:
        $ref: '#/components/requestBodies/PopulationMemberCollectionPost'
      responses:
        '200':
          description: Success
      security:
        - oauth2:
            - supercase:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Add to the draft population membership
      tags:
        - Supercases
    put:
      description: |
        Set the draft population membership to the population in this request.
        (Removing all current members if they exist.)
      operationId: peach.supercases.handlers.draft_population_members_set
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
        - $ref: '#/components/parameters/publishReviewTask'
      requestBody:
        $ref: '#/components/requestBodies/PopulationMemberCollectionPut'
      responses:
        '200':
          description: Success
      security:
        - oauth2:
            - supercase:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Set the draft population membership
      tags:
        - Supercases
  /supercases/{supercaseId}/populations/draft/members.csv:
    get:
      operationId: peach.supercases.handlers.draft_population_members_list_csv
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
      responses:
        '200':
          $ref: '#/components/responses/PopulationMemberCollectionCSVResponse'
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get membership as CSV
      tags:
        - Supercases
    post:
      description: >
        Add to the current population membership with the population in this
        request.

        Format is a CSV document.
      operationId: peach.supercases.handlers.draft_population_members_add_csv
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
      requestBody:
        $ref: '#/components/requestBodies/PopulationMemberCollectionCSVPost'
      responses:
        '200':
          description: Success
      security:
        - oauth2:
            - supercase:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Add to membership with CSV
      tags:
        - Supercases
    put:
      description: >
        Set the current population membership to the population in this request.
        (Removing

        all current members if they exist.) Format is a CSV document.
      operationId: peach.supercases.handlers.draft_population_members_set_csv
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
      requestBody:
        $ref: '#/components/requestBodies/PopulationMemberCollectionCSVPut'
      responses:
        '200':
          description: Success
      security:
        - oauth2:
            - supercase:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Set membership with CSV
      tags:
        - Supercases
  /supercases/{supercaseId}/populations/members.csv:
    get:
      operationId: peach.supercases.handlers.committed_members_list_csv
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
      responses:
        '200':
          $ref: '#/components/responses/PopulationMemberCollectionCSVResponse'
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get committed membership as CSV
      tags:
        - Supercases
  /supercases/{supercaseId}/populations/{populationId}:
    get:
      operationId: peach.supercases.handlers.population_get
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
        - $ref: '#/components/parameters/populationId'
      responses:
        '200':
          $ref: '#/components/responses/PopulationResponse'
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get population by ID
      tags:
        - Supercases
    put:
      description: Update the population.
      operationId: peach.supercases.handlers.population_update
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
        - $ref: '#/components/parameters/populationId'
      requestBody:
        $ref: '#/components/requestBodies/PopulationPut'
      responses:
        '200':
          $ref: '#/components/responses/PopulationResponse'
      security:
        - oauth2:
            - supercase:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update population
      tags:
        - Supercases
  /supercases/{supercaseId}/populations/{populationId}/bulk-send:
    post:
      operationId: peach.supercases.handlers.population_bulk_send_message
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
        - $ref: '#/components/parameters/populationId'
      requestBody:
        $ref: '#/components/requestBodies/BulkSendRequestBody'
      responses:
        '202':
          $ref: '#/components/responses/BulkOperationResponse'
      security:
        - oauth2:
            - supercase:bulk.send
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Send a message to the borrowers on all subcases of the population
      tags:
        - Supercases
  /supercases/{supercaseId}/populations/{populationId}/members:
    get:
      operationId: peach.supercases.handlers.population_members_list
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
        - $ref: '#/components/parameters/populationId'
      responses:
        '200':
          $ref: '#/components/responses/PopulationMemberCollectionResponse'
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get population membership
      tags:
        - Supercases
  /supercases/{supercaseId}/populations/{populationId}/members.csv:
    get:
      operationId: peach.supercases.handlers.population_members_list_csv
      parameters:
        - $ref: '#/components/parameters/components-parameters-supercaseId'
        - $ref: '#/components/parameters/populationId'
      responses:
        '200':
          $ref: '#/components/responses/PopulationMemberCollectionCSVResponse'
      security:
        - oauth2:
            - supercase:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get membership as CSV
      tags:
        - Supercases
  /teams:
    get:
      description: |
        Get all teams in a company
      operationId: peach.employees.handlers.teams.teams_get
      parameters:
        - $ref: '#/components/parameters/sortBy'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
      responses:
        '200':
          $ref: '#/components/responses/TeamsPaging'
      security:
        - oauth2:
            - team:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get teams
      tags:
        - Teams
    post:
      description: |
        Create a new team
      operationId: peach.employees.handlers.teams.teams_create
      requestBody:
        $ref: '#/components/requestBodies/TeamPost'
      responses:
        '200':
          $ref: '#/components/responses/Team'
      security:
        - oauth2:
            - team:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create team
      tags:
        - Teams
  /teams/{teamId}:
    delete:
      description: |
        Delete team
      operationId: peach.employees.handlers.teams.team_delete
      parameters:
        - $ref: '#/components/parameters/teamId'
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - team:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete team
      tags:
        - Teams
    get:
      description: |
        Get team by ID
      operationId: peach.employees.handlers.teams.team_get
      parameters:
        - $ref: '#/components/parameters/teamId'
      responses:
        '200':
          $ref: '#/components/responses/Team'
      security:
        - oauth2:
            - team:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get team by ID
      tags:
        - Teams
    put:
      description: |
        Update team
      operationId: peach.employees.handlers.teams.team_update
      parameters:
        - $ref: '#/components/parameters/teamId'
      requestBody:
        $ref: '#/components/requestBodies/TeamPost'
      responses:
        '200':
          $ref: '#/components/responses/Team'
      security:
        - oauth2:
            - team:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update
      tags:
        - Teams
  /twilio/tasktype-availability:
    get:
      operationId: peach.twilio.taskrouter.handlers.get_tasktype_availability
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        properties:
                          availableByDefault:
                            type: object
                          availableByUserConfig:
                            type: object
                          permitted:
                            type: object
                        type: object
                    type: object
          description: Success
      security:
        - oauth2:
            - taskrouter.task:receive
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get task availability
      tags:
        - Tasks
    put:
      operationId: peach.twilio.taskrouter.handlers.update_tasktype_availability
      requestBody:
        content:
          application/json:
            schema:
              properties:
                availableByUserConfig:
                  type: object
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        properties:
                          availableByDefault:
                            type: object
                          availableByUserConfig:
                            type: object
                          permitted:
                            type: object
                        type: object
                    type: object
          description: ok
      security:
        - oauth2:
            - taskrouter.task:receive
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update task type availability
      tags:
        - Tasks
  /users:
    get:
      operationId: peach.users.handlers.users_get
      parameters:
        - $ref: '#/components/parameters/sortBy'
        - $ref: '#/components/parameters/userTypeQuery'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
      responses:
        '200':
          $ref: '#/components/responses/UsersPaging'
      security:
        - oauth2:
            - user:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get users
      tags:
        - Users
    post:
      description: >
        Creates a user.


        `authType.email` or `authType.phone` is required depending on company
        configuration.


        `authType.password` is required unless the company is configured to
        `OneTimeCodeEmail` or `OneTimeCodeText` in which case sends an empty
        string.
      operationId: peach.users.handlers.user_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCreate'
        required: true
      responses:
        '201':
          $ref: '#/components/responses/User'
      security:
        - oauth2:
            - user:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: |
        Create user
      tags:
        - Users
  /users/{userId}:
    get:
      operationId: peach.users.handlers.user_get
      parameters:
        - $ref: '#/components/parameters/userId'
      responses:
        '200':
          $ref: '#/components/responses/User'
      security:
        - oauth2:
            - user:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get user
      tags:
        - Users
    put:
      operationId: peach.users.handlers.user_update
      parameters:
        - $ref: '#/components/parameters/userId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserUpdate'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/User'
      security:
        - oauth2:
            - user:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update user
      tags:
        - Users
  /users/{userId}/auth:
    put:
      description: |
        Replace the user's authentication values from scratch. The
        authentication type is derived from the company config.
      operationId: peach.security.handlers.user_auth_replace
      parameters:
        - $ref: '#/components/parameters/userId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewAuth'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SingletonResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/UserAuth'
                    type: object
          description: Success
      security:
        - oauth2:
            - user:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Replace user's auth based on configured company auth type
      tags:
        - Auth
  /users/{userId}/permissions:
    get:
      description: |
        Given
      operationId: peach.users.handlers.user_get_permissions
      parameters:
        - $ref: '#/components/parameters/userId'
      responses:
        '200':
          description: Success
      security:
        - oauth2:
            - user:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get user's current permissions
      tags:
        - Roles
  /users/{userId}/roles:
    get:
      operationId: peach.roles.handlers.user_role_get
      parameters:
        - $ref: '#/components/parameters/userId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
      responses:
        '200':
          $ref: '#/components/responses/RolesPaging'
      security:
        - oauth2:
            - role:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get user roles
      tags:
        - Roles
  /users/{userId}/roles/{roleId}:
    delete:
      operationId: peach.roles.handlers.user_role_delete
      parameters:
        - $ref: '#/components/parameters/roleId'
        - $ref: '#/components/parameters/userId'
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - role:unassign
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Remove role from user
      tags:
        - Roles
    put:
      operationId: peach.roles.handlers.user_role_update
      parameters:
        - $ref: '#/components/parameters/roleId'
        - $ref: '#/components/parameters/userId'
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
      security:
        - oauth2:
            - role:assign
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Add role to user
      tags:
        - Roles
  /v2/communicator/templates:
    get:
      description: |
        List all Templates Versions for all Template Descriptors.
      operationId: peach.communicator.handlers.list_template_versions_modern
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
        - $ref: '#/components/parameters/includeContextVars'
        - $ref: '#/components/parameters/includeContents'
        - $ref: '#/components/parameters/subjectFilterQuery'
        - $ref: '#/components/parameters/parameters-channel'
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Paging'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/TemplateVersion'
                        type: array
                    type: object
          description: OK
      security:
        - oauth2:
            - communicator.template:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: List all template versions (v2)
      tags:
        - Templates
  /verification-questions:
    get:
      description: >
        Retrieve all the questions which are available for use with verification
        types—i.e., the question bank.
      operationId: >-
        peach.borrower_verification.handlers.borrower_verification_questions_get_all
      responses:
        '200':
          $ref: '#/components/responses/VerificationQuestionsPaging'
      security:
        - oauth2:
            - verification:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get questions
      tags:
        - Verification Types
  /verification-types:
    get:
      operationId: peach.borrower_verification.handlers.borrower_verification_types_get_all
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
      responses:
        '200':
          $ref: '#/components/responses/VerificationTypesPaging'
      security:
        - oauth2:
            - verification-type:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get verification types
      tags:
        - Verification Types
    post:
      description: >
        Create a new borrower verification type.


        This represents one configuration of

        how to perform borrower verifications. Later, when starting a new
        borrower verification,

        you can then specify a particular verification type to use. This done by
        `POST`-ing to the

        `/people/{personId}/verifications` endpoint with a body like:


        ```json

        {
          "verificationTypeId": "VT-7RKX-OKQZ"
        }

        ```

        ### Using with CRM App UI


        In order to specify that the CRM application should make use a
        particular

        verification type you must set the company config value:
        `config.borrowerVerification.crmDefaultTypeId`

        to the ID of the verification type ID of the verification type you wish
        to use.


        e.g., `config.borrowerVerification.crmDefaultTypeId = "VT-7RKX-OKQZ"`
      operationId: peach.borrower_verification.handlers.borrower_verification_types_create
      requestBody:
        $ref: '#/components/requestBodies/VerificationTypePost'
      responses:
        '200':
          $ref: '#/components/responses/VerificationType'
      security:
        - oauth2:
            - verification-type:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create verification type
      tags:
        - Verification Types
  /verification-types/{verificationTypeId}:
    get:
      operationId: peach.borrower_verification.handlers.borrower_verification_types_get_one
      parameters:
        - $ref: '#/components/parameters/verificationTypeId'
      responses:
        '200':
          $ref: '#/components/responses/VerificationType'
      security:
        - oauth2:
            - verification-type:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get verification type by ID
      tags:
        - Verification Types
    put:
      operationId: peach.borrower_verification.handlers.borrower_verification_types_update
      parameters:
        - $ref: '#/components/parameters/verificationTypeId'
      requestBody:
        $ref: '#/components/requestBodies/VerificationTypePost'
      responses:
        '200':
          $ref: '#/components/responses/VerificationType'
      security:
        - oauth2:
            - verification-type:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update verification type
      tags:
        - Verification Types
  /webhooks:
    get:
      operationId: peach.webhooks.handlers.webhooks_list
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/endingBefore'
      responses:
        '200':
          $ref: '#/components/responses/WebhookSubscriptionPagingResponse'
      security:
        - oauth2:
            - webhook.subscription:list
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get webhooks
      tags:
        - Webhooks
    post:
      description: Creates a new webhook subscription.
      operationId: peach.webhooks.handlers.webhook_create
      parameters: []
      requestBody:
        $ref: '#/components/requestBodies/WebhookSubscriptionPost'
      responses:
        '200':
          $ref: '#/components/responses/WebhookSubscriptionResponse'
      security:
        - oauth2:
            - webhook.subscription:create
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Create webhook subscription
      tags:
        - Webhooks
  /webhooks/{webhookSubscriptionId}:
    delete:
      operationId: peach.webhooks.handlers.webhook_delete
      parameters:
        - $ref: '#/components/parameters/webhookSubscriptionId'
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - webhook.subscription:delete
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Delete webhook subscription
      tags:
        - Webhooks
    get:
      operationId: peach.webhooks.handlers.webhook_get
      parameters:
        - $ref: '#/components/parameters/webhookSubscriptionId'
      responses:
        '200':
          $ref: '#/components/responses/WebhookSubscriptionResponse'
      security:
        - oauth2:
            - webhook.subscription:read
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Get webhook subscription by ID
      tags:
        - Webhooks
    put:
      operationId: peach.webhooks.handlers.webhook_update
      parameters:
        - $ref: '#/components/parameters/webhookSubscriptionId'
      requestBody:
        $ref: '#/components/requestBodies/WebhookSubscriptionPut'
      responses:
        '200':
          $ref: '#/components/responses/WebhookSubscriptionResponse'
      security:
        - oauth2:
            - webhook.subscription:update
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Update webhook subscription
      tags:
        - Webhooks
  /webhooks/{webhookSubscriptionId}/ping:
    post:
      operationId: peach.webhooks.handlers.webhook_ping
      parameters:
        - $ref: '#/components/parameters/webhookSubscriptionId'
      responses:
        '204':
          description: Success
      security:
        - oauth2:
            - webhook.subscription:ping
        - bearerAuth: []
        - apiKeyHeader: []
      summary: Test a webhook with static payload.
      tags:
        - Webhooks
components:
  securitySchemes:
    apiKeyHeader:
      in: header
      name: X-API-KEY
      type: apiKey
      x-apikeyInfoFunc: peach.security.handlers.api_key_auth
      x-scopeValidateFunc: peach.security.handlers.scope_validate
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http
      x-bearerInfoFunc: peach.security.handlers.bearer_auth
      x-scopeValidateFunc: peach.security.handlers.scope_validate
    bearerAuthQuery:
      in: query
      name: token
      type: apiKey
      x-apikeyInfoFunc: peach.security.handlers.bearer_auth
      x-scopeValidateFunc: peach.security.handlers.scope_validate
    oauth2:
      flows: {}
      type: oauth2
      x-scopeValidateFunc: peach.security.handlers.scope_validate
      x-tokenInfoFunc: peach.security.handlers.oauth2
  parameters:
    companyId:
      description: The unique company identifier.
      in: path
      name: companyId
      required: true
      schema:
        type: string
    sortBy:
      description: The data attributes by which to sort the results.
      in: query
      name: sortBy
      required: false
      schema:
        items:
          type: string
        type: array
    limit:
      description: The maximum count of results to retrieve.
      in: query
      name: limit
      required: false
      schema:
        default: 25
        maximum: 100
        minimum: 1
        type: integer
    startingAfter:
      description: Return results starting after the provided object identifier.
      in: query
      name: startingAfter
      schema:
        type: string
    endingBefore:
      description: Return results ending before the provided object identifier.
      in: query
      name: endingBefore
      schema:
        type: string
    offset:
      description: Offset from the start of results.
      in: query
      name: offset
      required: false
      schema:
        minimum: 0
        type: integer
    companyIdQuery:
      description: The unique company identifier.
      in: query
      name: companyId
      schema:
        minimum: 1
        type: string
    domainQuery:
      description: A valid domain associated with a company
      in: query
      name: domain
      schema:
        type: string
    userTypeQuery:
      description: User type.
      in: query
      name: userType
      schema:
        $ref: '#/components/schemas/UserType'
    authTypeQuery:
      description: |
        The authentication type to explicitly use
      in: query
      name: authType
      schema:
        $ref: '#/components/schemas/AuthType'
    authValueTypeQuery:
      description: |
        The authentication value type to explicitly use
      in: query
      name: authValueType
      schema:
        $ref: '#/components/schemas/AuthValueType'
    appDomainTypeQuery:
      description: App Domain Type.
      in: query
      name: appDomainType
      schema:
        $ref: '#/components/schemas/AppDomainType'
    bulkSenderId:
      in: path
      name: bulkSenderId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    contactExporterId:
      description: The contactExporter object unique identifier.
      in: path
      name: contactExporterId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    borrowerCampaignId:
      in: path
      name: borrowerCampaignId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    borrowerCampaignRunId:
      in: path
      name: borrowerCampaignRunId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    downloadFile:
      description: >
        Specify which file should be downloaded from this campaign run. The
        requested files will be returned as a `.zip` file.


        - `query_results.csv` - A CSV formatted file of the query results
        received from Redash

        - `campaign_input.json` - A JSON formatted file of the parsed query
        results used as input to the campaign

        - `contacts.csv` - The exported contacts as CSV—i.e., the output.

        - `log.txt` - A log of the campaign run process.
      in: query
      name: file
      schema:
        default: all
        enum:
          - all
          - query_results.csv
          - campaign_input.json
          - contacts.csv
          - log.txt
        type: string
    cardIssuerId:
      description: The ID of the card issuer
      in: path
      name: cardIssuerId
      required: true
      schema:
        type: string
    loanTypeIdFilter:
      description: Use this to limit results to a specific lender product.
      in: query
      name: loanTypeId
      schema:
        items:
          $ref: '#/components/schemas/AnyId'
        type: array
    smartReviewsEnable:
      description: |
        Filter for case types that have enabled smart review tasks.
      in: query
      name: smartReviewsEnable
      required: false
      schema:
        type: boolean
    caseTypeId:
      description: |
        The case type unique identifier.
      in: path
      name: caseTypeId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    version:
      description: >-
        Optional argument. If provided, the action will be performed on the
        specified `version`.
      in: query
      name: version
      schema:
        format: int32
        type: integer
    caseTypeSmartReviewsAsOfDate:
      description: >
        What date to process smart review criterion. If `null`, process today.
        Can

        not be a date in the future.
      in: query
      name: asOfDate
      schema:
        format: date
        type: string
    expand:
      description: Replace component IDs with corresponding objects
      in: query
      name: expand
      schema:
        default: false
        type: boolean
    includeFields:
      description: |
        A comma separated list of field names to include in the response.
      in: query
      name: include
      schema:
        items:
          type: string
        minItems: 1
        type: array
    associations:
      description: >
        Type of related object to return with the case data.

        - If `null`, no references to related objects are inserted into the
        response.

        - If `all`, insert an array of all relations

        - Otherwise insert array of single type.
      in: query
      name: associations
      required: false
      schema:
        enum:
          - all
          - documents
          - cases
          - interactions
          - loans
        type: string
    caseOutcome:
      in: query
      name: outcome
      required: false
      schema:
        enum:
          - all
          - approved
          - denied
          - falsePositive
          - noOutcome
        type: string
    caseStatus:
      in: query
      name: status
      required: false
      schema:
        enum:
          - all
          - initiated
          - processing
          - completed
          - canceled
          - reopened
        type: string
    caseStatuses:
      in: query
      name: statuses
      required: false
      schema:
        items:
          enum:
            - all
            - initiated
            - processing
            - completed
            - canceled
            - reopened
          type: string
        type: array
    caseStatusUpdatedBefore:
      description: >
        Filter by cases which have a `statusUpdatedAt` date-time from before the
        given value
      in: query
      name: statusUpdatedBefore
      required: false
      schema:
        format: date-time
        type: string
    caseStatusUpdatedAfter:
      description: >
        Filter by cases which have a `statusUpdatedAt` date-time after the given
        value
      in: query
      name: statusUpdatedAfter
      required: false
      schema:
        format: date-time
        type: string
    caseNumber:
      description: Filter cases by external case number
      in: query
      name: caseNumber
      required: false
      schema:
        type: string
    caseType:
      description: |
        The name of the case type.
      in: query
      name: caseType
      schema:
        enum:
          - generic
          - bankruptcy
          - ceaseCommunication
          - collection
          - deceased
          - disputeOfDebt
          - federalEmergency
          - identityTheft
          - legalAction
          - militaryDuty
          - debtValidation
          - oFACSanctionedIndividual
          - creditBureauDispute
        type: string
    createdBefore:
      description: >
        Filter by cases which have a `createdAt` date-time before the given
        value
      in: query
      name: createdBefore
      required: false
      schema:
        format: date-time
        type: string
    createdAfter:
      description: |
        Filter by cases which have a `createdAt` date-time after the given value
      in: query
      name: createdAfter
      required: false
      schema:
        format: date-time
        type: string
    nupUpdatedNull:
      description: >
        Filters to cases that have been sent in the NUP file if true, otherwise
        filters them out if false.

        (Only applies to Bankruptcy cases)
      in: query
      name: nupUpdatedNull
      required: false
      schema:
        type: boolean
    snoozedUntilBefore:
      description: >
        Filter only cases with a snooze (the `snoozeUntil` value) set to expire
        before the specified datetime. Note that a

        snoozed case is set to None automatically very shortly after it expires.
      in: query
      name: snoozedUntilBefore
      schema:
        format: date-time
        type: string
    snoozedUntilAfter:
      description: >
        Filter only cases with a snooze (the `snoozeUntil` value) set to expire
        after the specified datetime.
      in: query
      name: snoozedUntilAfter
      schema:
        format: date-time
        type: string
    owningEmployeeId:
      description: >
        Filter by cases which have an `owningEmployeeId` equal to the given
        employee

        ID. If the employee ID is `null`, filter by cases which have no owning
        employee.
      in: query
      name: owningEmployeeId
      schema:
        type: string
    loanTypes:
      description: |
        Filter by a list of loan types. Only includes cases with loans of the
        specified loan types. Special value `none` means to include cases with
        no associated loans.
      in: query
      name: loanTypes
      schema:
        items:
          enum:
            - none
            - lineOfCredit
            - installment
          type: string
        type: array
    filterInteractionStatus:
      description: >
        Filter cases which have an associated interaction with the specified
        status.
      in: query
      name: interaction.status
      schema:
        items:
          $ref: '#/components/schemas/InteractionStatus'
        type: array
    filterInteractionChannel:
      description: >
        Filter cases which have an associated interaction with the specified
        channel.
      in: query
      name: interaction.channel
      schema:
        items:
          $ref: '#/components/schemas/InteractionChannel'
        type: array
    filterInteractionScheduledAtFromBefore:
      description: >
        Filter cases which have an associated interaction with a scheduled start
        date-time

        before the specified value. (i.e., the specified value is less than or
        equal to `scheduledAtFrom`.)
      in: query
      name: interaction.scheduledAtFromBefore
      schema:
        format: date-time
        type: string
    filterInteractionScheduledAtFromAfter:
      description: >
        Filter cases which have an associated interaction with a scheduled start
        date-time

        after the specified value. (i.e., the specified value is greater than or
        equal to `scheduledAtFrom`.)
      in: query
      name: interaction.scheduledAtFromAfter
      schema:
        format: date-time
        type: string
    filterInteractionScheduledAtToBefore:
      description: >
        Filter cases which have an associated interaction with a scheduled end
        date-time

        before the specified value. (i.e., the specified value is less than or
        equal to `scheduledAtTo`.)
      in: query
      name: interaction.scheduledAtToBefore
      schema:
        format: date-time
        type: string
    filterInteractionScheduledAtToAfter:
      description: >
        Filter cases which have an associated interaction with a scheduled end
        date-time

        after the specified value. (i.e., the specified value is greater than or
        equal to `scheduledAtTo`.)
      in: query
      name: interaction.scheduledAtToAfter
      schema:
        format: date-time
        type: string
    associatedDocumentId:
      description: |
        Filter by an associated document ID, public or external. Only includes
        cases that have been associated with the given document ID.
      in: query
      name: associatedDocumentId
      schema:
        type: string
    renderFormat:
      description: The desired output format.
      in: query
      name: fmt
      schema:
        default: html
        enum:
          - text
          - html
          - pdf
        type: string
    subject:
      in: path
      name: subject
      required: true
      schema:
        $ref: '#/components/schemas/InteractionSubject'
    parameters-companyIdQuery:
      description: The Company ID by which to filter.
      example: CP-AAAA-BBBB
      in: query
      name: companyId
      schema:
        $ref: '#/components/schemas/CompanyId'
    descriptorId:
      description: ID of the Template Descriptor.
      example: TD-AAAA-BBBB
      in: path
      name: descriptorId
      required: true
      schema:
        $ref: '#/components/schemas/TemplateDescriptorId'
    templateVersionId:
      description: The Template Version ID.
      in: path
      name: templateVersionId
      required: true
      schema:
        $ref: '#/components/schemas/TemplateVersionId'
    includeArchived:
      description: |
        If set to true, includes archived objects
      in: query
      name: includeArchived
      schema:
        default: false
        type: boolean
    collectionAgencyId:
      description: The ID of the collection agency
      in: path
      name: collectionAgencyId
      required: true
      schema:
        type: string
    uploadedByLender:
      description: >
        If `true`, only returns Credit Agency objects that have the SFTP
        credentials filled in, meaning the lender will upload the file to the
        credit agency.


        If `false`, only returns Credit Agency objects that have the SFTP
        credentials empty, meaning Peach will upload the file to the credit
        agency.


        If not set, includes all.
      in: query
      name: uploadedByLender
      schema:
        type: boolean
    creditAgencyId:
      description: The ID of the credit agency
      in: path
      name: creditAgencyId
      required: true
      schema:
        type: string
    interactionId:
      description: |
        Interaction's unique identifier to track interactions for. Can be Peach
        or lender's external identifier.
      in: path
      name: interactionId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    callTranscriptionResultStatus:
      description: |
        The status of the transcription result.
      in: query
      name: status
      required: false
      schema:
        enum:
          - pending
          - completed
          - failed
        type: string
    aICallTranscriptionResultIdFilter:
      description: |
        Filter by the AI Call Transcription Result ID.
      in: query
      name: aICallTranscriptionResultId
      required: false
      schema:
        type: string
    parameters-includeFields:
      description: >
        A list of additional interaction relationships to include in the
        response object. 


        - When `include=borrower` the `borrower` field will be populated
        (otherwise it will be `null`). This
          is data describing the borrower associated with this interaction.
        - When `include=contact` the `contact`` field will be populated
        (otherwise it will be `null`). This is
          contact data for the contact this interaction was sent to or from.
        - When `include=lastTaskMeta` the `lastTaskMeta` field will be populated
        (otherwise it will be `null`).
          This is meta data about the most recently ended task associated with this interaction.

        You can include multiple fields by passing multiple values, e.g.,
        `include=borrower,contact`.
      in: query
      name: include
      required: false
      schema:
        items:
          enum:
            - borrower
            - contact
            - lastTaskMeta
          type: string
        minItems: 1
        type: array
    contactValidate:
      description: >-
        Validate the contact through an external API. This is only used for
        addresses currently.
      in: query
      name: validate
      required: false
      schema:
        default: true
        type: boolean
    investorId:
      description: Unique investor identifier.
      in: path
      name: investorId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    settlementInstrumentId:
      description: Unique settlement instrument identifier. Normally a bank account.
      in: path
      name: settlementInstrumentId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    parameters-createdBefore:
      description: >
        Returns loan labels created before a specific timestamp. If used in
        conjunction with `createdAfter`,

        a time range can be created to return labels created between two
        timestamps.
      in: query
      name: createdBefore
      schema:
        format: date-time
        type: string
    parameters-createdAfter:
      description: >
        Returns loan labels created before a specific timestamp. If used in
        conjunction with `createdBefore`,

        a time range can be created to return labels created between two
        timestamps.
      in: query
      name: createdAfter
      schema:
        format: date-time
        type: string
    loanFilter:
      description: >
        Filter by Loan's unique identifier. Can be Peach or lender's external
        identifier.
      in: query
      name: loanId
      schema:
        $ref: '#/components/schemas/AnyId'
    loanLabelIds:
      description: The IDs of the loan labels
      in: path
      name: loanLabelIds
      required: true
      schema:
        items:
          type: string
        maxItems: 100
        type: array
    loanLabelId:
      description: The ID of the loan label
      in: path
      name: loanLabelId
      required: true
      schema:
        type: string
    loanTapeTypeId:
      description: The ID of the loan tape type
      in: path
      name: loanTapeTypeId
      required: true
      schema:
        type: string
    untokenize:
      description: >-
        Untokenize any tokenized fields if the calling user has the applicable
        permission.
      in: query
      name: untokenize
      schema:
        default: false
        type: boolean
    loanTapeId:
      description: The ID of the loan tape
      in: path
      name: loanTapeId
      required: true
      schema:
        type: string
    loanTypeId:
      description: The loan type identifier.
      in: path
      name: loanTypeId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    sendChannels:
      description: >
        If specified, only include notification types with at least one of the
        specified `sendChannels`.

        If not provided, including any notification types regardless of the
        `sendChannels`.
      in: query
      name: sendChannels
      schema:
        items:
          $ref: '#/components/schemas/ValidInteractionChannel'
        type: array
    repaymentNotificationTypeId:
      description: The notification type identifier.
      in: path
      name: repaymentNotificationTypeId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    loanId:
      description: |
        The unique identifier of the Loan we wish to retrieve. Can be
        Peach or lender's external identifier.
      in: path
      name: loanId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    promiseToPayPlanId:
      description: |
        The identifier of a promise to pay plan.
      in: path
      name: promiseToPayPlanId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    parentMerchantId:
      description: >
        The parent merchant identifier. Used to represent hierarchy of merchant
        sub entities.

        Can be Peach or lender's external identifier.
      in: query
      name: parentMerchantId
      required: false
      schema:
        $ref: '#/components/schemas/AnyId'
    merchantId:
      description: A lender's identifier for the merchant.
      in: path
      name: merchantId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    paymentProcessorId:
      description: The payment processor ID.
      in: path
      name: paymentProcessorId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    achFileId:
      description: The ACH File upload monitoring record ID.
      in: path
      name: achFileId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    fundingInstrumentId:
      description: Unique funding instrument identifier. Normally a bank account.
      in: path
      name: fundingInstrumentId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    personId:
      description: >
        A Borrower's unique identifier, tied to a person or a business. Can be
        Peach or a lender's external identifier.
      in: path
      name: personId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    caseId:
      description: The case object unique identifier.
      in: path
      name: caseId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    workflowStepId:
      description: The workflow step ID
      in: path
      name: workflowStepId
      required: true
      schema:
        type: string
    workflowWorkitemId:
      description: The workflow work item ID
      in: path
      name: workflowWorkitemId
      required: true
      schema:
        type: string
    promoProgramTypeStatus:
      description: |
        Filter promo program types by status. `inactive` matches types stored
        as either `inactive` or the legacy `deprecated` value.
      in: query
      name: status
      required: false
      schema:
        enum:
          - draft
          - active
          - inactive
          - archived
        type: string
    promoProgramTypeId:
      description: The promotional program type identifier.
      in: path
      name: promoProgramTypeId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    taskWorkerPairingConfigSortBy:
      description: Which fields to sort by
      in: query
      name: sortBy
      required: false
      schema:
        default:
          - '-priority'
        items:
          enum:
            - id
            - +id
            - '-id'
            - priority
            - '-priority'
            - +priority
            - createdAt
            - +createdAt
            - '-createdAt'
          type: string
        type: array
    taskWorkerPairingConfigId:
      in: path
      name: taskWorkerPairingConfigId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    taskHistoryId:
      description: The `id` or `sid` of the terminated task
      in: path
      name: taskHistoryId
      required: true
      schema:
        type: string
    taskQueueSid:
      description: |
        The SID of the TaskQueue with the Tasks to read.
      in: query
      name: taskQueueSid
      required: false
      schema:
        type: string
    taskAssignmentStatus:
      description: >
        The assignment status of the


        Note that the assignment status cannot be `completed` or `canceled`
        because

        "unterminated" tasks are never `completed` or `canceled`—by definition
        tasks

        of that status are "terminated".
      explode: false
      in: query
      name: assignmentStatus
      required: false
      schema:
        items:
          enum:
            - pending
            - reserved
            - assigned
            - wrapping
          type: string
        type: array
      style: form
    taskType:
      description: |
        Only display tasks matching any these task types
      explode: false
      in: query
      name: taskType
      required: false
      schema:
        items:
          $ref: '#/components/schemas/TaskType'
        type: array
      style: form
    parameters-caseType:
      description: |
        Only display tasks with a case with a matching any of these case type
      explode: false
      in: query
      name: caseType
      required: false
      schema:
        items:
          $ref: '#/components/schemas/BaseCaseType'
        type: array
      style: form
    parameters-caseId:
      description: |
        Only display tasks with a case ID which matches any of these case IDs
      explode: false
      in: query
      name: caseId
      required: false
      schema:
        items:
          type: string
        type: array
      style: form
    supercaseId:
      description: >
        Only display tasks with a supercase ID which matches any of these
        supercase IDs
      explode: false
      in: query
      name: supercaseId
      required: false
      schema:
        items:
          type: string
        type: array
      style: form
    parameters-interactionId:
      description: >
        Only display tasks with an interaction ID which matches any of these
        interaction IDs
      explode: false
      in: query
      name: interactionId
      required: false
      schema:
        items:
          type: string
        type: array
      style: form
    unableToComplete:
      description: >
        If `true`, only display tasks which were created by an agent clicking
        "Unable to Complete".

        If `false`, display only *other* tasks.
      in: query
      name: unableToComplete
      required: false
      schema:
        type: boolean
    taskAttrMatchExpr:
      description: >
        A Taskrouter expression to use for matching the task by task attributes.


        This field's syntax must conform to the Twilio "TaskRouter Expression"
        syntax[1].


        [1] https://www.twilio.com/docs/taskrouter/expression-syntax
      in: query
      name: taskAttrMatchExpr
      required: false
      schema:
        type: string
    hasCase:
      description: |
        Only display tasks which have a case associated with them.
      in: query
      name: hasCase
      required: false
      schema:
        type: boolean
    hasCaseOwner:
      description: >
        Only display tasks which has a case with an owner when the task was
        published.


        (Note that this filters based on the data in the task object, which
        represents the state of the

        case at the moment the task was published.)
      in: query
      name: hasCaseOwner
      required: false
      schema:
        type: boolean
    taskSid:
      description: The `sid` of the task
      in: path
      name: taskSid
      required: true
      schema:
        type: string
    workflowStepTypeId:
      description: The workflow step type ID
      in: path
      name: workflowStepTypeId
      required: true
      schema:
        type: string
    workflowTypeId:
      description: The workflow type ID
      in: path
      name: workflowTypeId
      required: true
      schema:
        type: string
    workflowWorkitemTypeId:
      description: The work item type ID
      in: path
      name: workflowWorkitemTypeId
      required: true
      schema:
        type: string
    derivedFromTypeId:
      in: query
      name: derivedFromTypeId
      schema:
        $ref: '#/components/schemas/AnyId'
    codeId:
      description: The ID of the desired code
      in: path
      name: codeId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    typeId:
      description: >-
        Optional argument. If provided, will create a new type from the
        specified `typeId`.
      in: query
      name: typeId
      schema:
        format: int32
        type: integer
    doNotInteractTypeId:
      description: |
        The Do Not Interact Type unique identifier.
      in: path
      name: doNotInteractTypeId
      required: true
      schema:
        type: integer
    documentUploadLinkKey:
      description: >
        The doc upload link key. Used to perform document upload operations
        without

        logging into Peach system. This should be treated as *secret*, because
        anyone

        in possession of this key can upload on behalf the borrower for which it
        was

        created. Not to be confused with the `documentUploadLinkId`.
      in: path
      name: documentUploadLinkKey
      required: true
      schema:
        type: string
    documentDescriptorId:
      description: The document descriptor identifier.
      in: path
      name: documentDescriptorId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    queryTeamId:
      description: |
        ** DEPRECATED - use `teamIds` ** Filter results to a single team.
      in: query
      name: teamId
      schema:
        $ref: '#/components/schemas/AnyId'
    queryTeamIds:
      description: >-
        Filter results to employees that belong to at least one of a list of
        teams.
      in: query
      name: teamIds
      schema:
        items:
          $ref: '#/components/schemas/AnyId'
        type: array
    queryExcludeTeamIds:
      description: >-
        Filter results to employees that do not belong to any of a list of
        teams.
      in: query
      name: excludeTeamIds
      schema:
        items:
          $ref: '#/components/schemas/AnyId'
        type: array
    queryManagerEmployeeId:
      description: The employee ID of the manager
      in: query
      name: managerEmployeeId
      schema:
        $ref: '#/components/schemas/AnyId'
    queryEmployeeSearch:
      description: >
        The search term on which to search. It will match ANY employee when the
        search term matches the following:


        - case-insensitive matches any substring of an employee's first name

        - case-insensitive matches any substring of an employee's last name

        - if there is whitespace in the search term, split on the whitespace,
        and case-insensitive match the first part to any substring of an
        employee's first name and the second part to any substring of the last
        name

        - exactly matches an employee's user's ID

        - exactly matches an employee's ID

        - exactly matches an employee's external ID (prefixed with `ext-`)

        - exactly matches one of employee's role IDs
      in: query
      name: search
      required: false
      schema:
        type: string
    employeeId:
      description: The unique employee identifier.
      in: path
      name: employeeId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    teamId:
      description: The unique team identifier.
      in: path
      name: teamId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    personFilter:
      description: >
        Filter by a Borrower's unique identifier. Can be Peach or lender's
        external identifier.
      in: query
      name: personId
      schema:
        $ref: '#/components/schemas/AnyId'
    periodIdQuery:
      description: Use this to limit results to a specific periodId.
      in: query
      name: periodId
      schema:
        type: string
    caseFilter:
      description: >
        Filter by case's object unique identifier. Can be Peach or lender's
        external identifier.
      in: query
      name: caseId
      schema:
        $ref: '#/components/schemas/AnyId'
    transactionFilter:
      description: >
        Filter by transaction's unique identifier. Can be Peach or lender's
        external identifier.
      in: query
      name: transactionId
      schema:
        $ref: '#/components/schemas/AnyId'
    createdAtFrom:
      description: Get events created at or after the specified time.
      in: query
      name: createdAtFrom
      schema:
        format: date-time
        type: string
    createdAtTo:
      description: Get events created before the specified time.
      in: query
      name: createdAtTo
      schema:
        format: date-time
        type: string
    effectiveAtFrom:
      description: Get events effective at or after the specified time.
      in: query
      name: effectiveAtFrom
      schema:
        format: date-time
        type: string
    effectiveAtTo:
      description: Get events effective before the specified time.
      in: query
      name: effectiveAtTo
      schema:
        format: date-time
        type: string
    accrualDate:
      description: >-
        Get events by matching accrual date. To be used for AccrueInterestEvent
        only.
      in: query
      name: accrualDate
      schema:
        format: date
        type: string
    includeDeleted:
      description: Include events that have been deleted.
      in: query
      name: includeDeleted
      schema:
        default: true
        type: boolean
    includeEventTypes:
      description: >
        A comma separated list of event names to return.

        Event name queries can end with a wildcard `*` character to specify all
        events starting with the given string.

        For example, `case.*` would give all case-related events.
      in: query
      name: events
      schema:
        type: string
    excludeEventTypes:
      description: >
        A comma separated list of event names to exclude from the response.

        Event name queries can end with a wildcard `*` character to specify all
        events starting with the given string.

        For example, `case.*` would exclude all case-related events.
      in: query
      name: excludeEvents
      schema:
        type: string
    webhookId:
      description: >
        The webhook ID to filter events by. This will only include events that
        were sent to this webhook subscription.
      in: query
      name: webhookId
      schema:
        type: string
    parameters-supercaseId:
      description: >
        The supercase ID to filter events by. Events that don't have this field
        will be filtered out.
      in: query
      name: supercaseId
      schema:
        type: string
    skipTotalCount:
      description: >
        Skip computing the exact `total` count of matching events to improve
        performance.

        When `true`, `total` is returned as an arbitrary large value and must
        not be relied upon.
      in: query
      name: skipTotalCount
      schema:
        default: false
        type: boolean
    hasNoPerson:
      description: >
        If `true`, include only unassociated interactions—those not associated
        with a borrower.

        If `false`, include only interactions associated with a borrower.

        If unset, include any interaction regardless of it being associated with
        a borrower or not.
      in: query
      name: hasNoPerson
      schema:
        type: boolean
    channel:
      description: |
        Exactly match the channel over which the interaction took place.
      in: query
      name: channel
      required: false
      schema:
        items:
          $ref: '#/components/schemas/InteractionChannel'
        type: array
    direction:
      description: >
        Exactly match the direction the interaction—either `inbound` or
        `outbound`.
      in: query
      name: direction
      required: false
      schema:
        $ref: '#/components/schemas/InteractionDirection'
    status:
      description: |
        Exactly match the status of an interaction.
      in: query
      name: status
      required: false
      schema:
        items:
          $ref: '#/components/schemas/InteractionStatus'
        type: array
    statusDetails:
      description: |
        Exactly match the status details of an interaction.
      in: query
      name: statusDetails
      required: false
      schema:
        items:
          $ref: '#/components/schemas/InteractionStatusDetails'
        type: array
    agentOutcome:
      description: |
        Exactly match the `agentOutcome` of an interaction.
      in: query
      name: agentOutcome
      required: false
      schema:
        items:
          $ref: '#/components/schemas/InteractionAgentOutcome'
        type: array
    parameters-subject:
      description: >
        The interaction subject value(s) by which to filter. To match
        interactions

        without a subject pass the string "null".
      in: query
      name: subject
      required: false
      schema:
        items:
          type: string
        type: array
    theme:
      in: query
      name: theme
      required: false
      schema:
        items:
          $ref: '#/components/schemas/InteractionTheme'
        type: array
    caseIds:
      description: |
        Exactly matches one of several Peach case IDs (`CS-XXXX-XXXX`).
      in: query
      name: caseIds
      required: false
      schema:
        items:
          type: string
        type: array
    contentContains:
      description: |
        Search for an exact match in the content of the interaction
      in: query
      name: contentContains
      required: false
      schema:
        type: string
    createdAtBefore:
      description: |
        Filter only objects that were not created at or before the specified
        timestamp. This timestamp is in UTC.
      in: query
      name: createdAtBefore
      schema:
        format: date-time
        type: string
    createdAtAfter:
      description: |
        Filter only objects that were not created at or after the specified
        timestamp. This timestamp is in UTC.
      in: query
      name: createdAtAfter
      schema:
        format: date-time
        type: string
    startedAtBefore:
      description: |
        Filter only objects that were not started at or before the specified
        timestamp. This timestamp is in UTC.
      in: query
      name: startedAtBefore
      schema:
        format: date-time
        type: string
    startedAtAfter:
      description: |
        Filter only objects that were not started at or after the specified
        timestamp. This timestamp is in UTC.
      in: query
      name: startedAtAfter
      schema:
        format: date-time
        type: string
    scheduledAtFromBefore:
      description: >
        Include only interactions which have a `scheduledAtFrom` set to before
        (or equal to) this

        timestamp. The timestamp must include a timezone (or UTC offset).
      in: query
      name: scheduledAtFromBefore
      schema:
        format: date-time
        type: string
    scheduledAtFromAfter:
      description: >
        Include only interactions which have a `scheduledAtFrom` set to after
        (or equal to) this

        timestamp. The timestamp must include a timezone (or UTC offset).
      in: query
      name: scheduledAtFromAfter
      schema:
        format: date-time
        type: string
    scheduledAtToBefore:
      description: >
        Include only interactions which have a `scheduledAtTo` set to before (or
        equal to) this

        timestamp. The timestamp must include a timezone (or UTC offset).
      in: query
      name: scheduledAtToBefore
      schema:
        format: date-time
        type: string
    scheduledAtToAfter:
      description: >
        Include only interactions which have a `scheduledAtTo` set to after (or
        equal to) this

        timestamp. The timestamp must include a timezone (or UTC offset).
      in: query
      name: scheduledAtToAfter
      schema:
        format: date-time
        type: string
    createdBy:
      description: >
        The User ID or Employee ID of the user which created the interaction.


        If `null` is specified then match all interactions with `createdBy` of
        `null`.
      in: query
      name: createdBy
      required: false
      schema:
        nullable: true
        type: string
    hasVoicemail:
      description: >
        If `true`, include only interactions with voicemails—only valid for
        `channel=voice`case.

        If `false`, include only interactions without voicemails.

        If unset, then include any interaction regardless of it having voicemail
        or not.


        Note that a voicemail is different from a call recording. A voicemail is
        an audio message

        left by a caller when no pickup by the company was possible. e.g., the
        call was made while the office was

        closed or while there were no agents available to answer the call.
      in: query
      name: hasVoicemail
      required: false
      schema:
        type: boolean
    hasRecording:
      description: >
        If `true` match only interactions with call recordings—only valid for
        `channel=voice`.

        If `false` match only interactions without call recordings.

        If unset, match any interaction regardless of it have a recording or
        not.


        Note that a call recording is when an agent chooses to record a call,
        which is

        different from a voicemail.
      in: query
      name: hasRecording
      required: false
      schema:
        type: boolean
    sensitive:
      description: >
        If `true`, include only interactions with the `sensitive` property set
        to `true`.

        If `false`, include only interactions with the `sensitive` property set
        to `false`.

        If unset, include any interaction regardless of `sensitive` property.
      in: query
      name: sensitive
      required: false
      schema:
        nullable: true
        type: boolean
    isExternal:
      description: >
        If `true`, include only interactions with the `isExternal` property set
        to `true`.

        If `false`, include only interactions with the `isExternal` property set
        to `false`.

        If unset, include any interaction regardless of `isExternal` property.
      in: query
      name: isExternal
      required: false
      schema:
        nullable: true
        type: boolean
    searchable:
      description: >-
        If `true`, format the entire response as one suitable for an
        ElasticSearch search index.
      in: query
      name: searchable
      schema:
        default: false
        type: boolean
    noteCategories:
      description: |
        Filters by the given note categories
      in: query
      name: categories
      schema:
        items:
          $ref: '#/components/schemas/NoteCategory'
        type: array
    notePinned:
      description: |
        If `true`, show only pinned notes. If `false`, exclude them. If
        `null`, do no filtering.
      in: query
      name: pinned
      schema:
        default: null
        nullable: true
        type: boolean
    disposition:
      description: >
        Tells the response from the file download to set the
        `Content-Disposition` header

        to the given value.

        - `attachment` means "download the file"

        - `inline` means "open the file in the default manner". e.g., if the
        file were an
          `.mp3` the browser's default audio player would open.
      in: query
      name: disposition
      schema:
        enum:
          - inline
          - attachment
        type: string
    returnUrl:
      description: >-
        If `true`, will return a URL to the content instead of redirecting to
        the content.
      in: query
      name: returnUrl
      required: false
      schema:
        default: false
        type: boolean
    APIKeyStatus:
      in: query
      name: status
      required: false
      schema:
        default: active
        enum:
          - active
          - inactive
        type: string
    APIKeyId:
      description: The API key id.
      in: path
      name: keyId
      required: true
      schema:
        type: string
    indexRateId:
      description: The index rate identifier. Can be Peach or lender's external identifier.
      in: path
      name: indexRateId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    fieldsGetLoans:
      description: |2-

                The result fields that will be fetched:

                `all` - Fetch all fields.

                `idsOnly` - Fetch only the following fields: `id`, `externalId`, `loanTypeId`, `mainBorrowerId`, `mainBorrowerExternalId`, `lockStatus`, and `migrationStatus`.
      in: query
      name: fields
      required: false
      schema:
        default: all
        enum:
          - all
          - idsOnly
        type: string
    loanStatuses:
      description: A comma separated list of loan statuses to filter by
      in: query
      name: statuses
      required: false
      schema:
        items:
          enum:
            - all
            - active
            - pending
            - originated
            - declined
            - frozen
            - accelerated
            - chargedOff
            - paidOff
            - canceled
          type: string
        type: array
    managedByPeach:
      description: >
        If passed, only returns loans with a loan type with "managed by peach"
        set to this value.
      in: query
      name: managedByPeach
      schema:
        nullable: true
        type: boolean
    includeAdditionalBorrowers:
      description: >
        If set to `true`, include the `addtionalBorrowers` field containing
        information

        about other borrowers related to this loan, e.g., cosigner, coborrowers,
        and applicants.
      in: query
      name: includeAdditionalBorrowers
      required: false
      schema:
        default: false
        type: boolean
    loanLabels:
      description: A comma separated list of loan labels to filter by
      in: query
      name: labels
      required: false
      schema:
        items:
          type: string
        type: array
    updatedAtBefore:
      description: |
        Filter only objects that were not updated at or before the specified
        timestamp. This timestamp is in UTC.
      in: query
      name: updatedAtBefore
      schema:
        format: date-time
        type: string
    updatedAtAfter:
      description: |
        Filter only objects that were not updated at or after the specified
        timestamp. This timestamp is in UTC.
      in: query
      name: updatedAtAfter
      schema:
        format: date-time
        type: string
    originatedAtAfter:
      description: |
        Filter only objects that were not originated at or after the specified
        timestamp. This timestamp is in UTC.
      in: query
      name: originatedAtAfter
      schema:
        format: date-time
        type: string
    originatedAtBefore:
      description: |
        Filter only objects that were not originated at or before the specified
        timestamp. This timestamp is in UTC.
      in: query
      name: originatedAtBefore
      schema:
        format: date-time
        type: string
    activatedAtBefore:
      description: |
        Filter only objects that were not activated at or before the specified
        timestamp. This timestamp is in UTC.
      in: query
      name: activatedAtBefore
      schema:
        format: date-time
        type: string
    activatedAtAfter:
      description: |
        Filter only objects that were not activated at or after the specified
        timestamp. This timestamp is in UTC.
      in: query
      name: activatedAtAfter
      schema:
        format: date-time
        type: string
    sortByForLoans:
      description: The data attributes by which to sort the results.
      in: query
      name: sortBy
      required: false
      schema:
        items:
          enum:
            - createdAt
            - +createdAt
            - '-createdAt'
            - updatedAt
            - +updatedAt
            - '-updatedAt'
            - originatedAt
            - +originatedAt
            - '-originatedAt'
            - activatedAt
            - +activatedAt
            - '-activatedAt'
          type: string
        type: array
    loansDueDate:
      description: If passed, only returns loans with a due date equal to this value.
      in: query
      name: dueDate
      required: false
      schema:
        format: date
        type: string
    notificationTypeId:
      description: |
        The Notification Type unique identifier.
      in: path
      name: notificationTypeId
      required: true
      schema:
        type: integer
    operationId:
      description: |
        Operation ID
      in: path
      name: operationId
      required: true
      schema:
        maxLength: 32
        minLength: 32
        type: string
    skipConnectionTest:
      description: >-
        Skip SFTP connection test. This is not recommended - use only after
        consulting with Peach.
      in: query
      name: skipConnectionTest
      required: false
      schema:
        default: false
        type: boolean
    borrowerStatus:
      description: Status of borrower(s).
      in: query
      name: status
      schema:
        enum:
          - active
          - inactive
        type: string
    borrowerType:
      description: Exactly match the type of borrower.
      in: query
      name: borrowerType
      schema:
        enum:
          - business
          - person
        type: string
    queryIds:
      description: List of IDs.
      explode: false
      in: query
      name: ids
      schema:
        items:
          type: string
        type: array
      style: form
    _hasTheWords:
      description: >
        Performs fuzzy matching on all fuzzy-matchable search fields and exact
        matching on all

        exact-matchable search fields.


        For example, `_hasTheWords=Rob` will match a `firstName` of `Robby` a
        `lastName` of

        `Roberts` and street address of `123 Robinson Dr`.
      in: query
      name: _hasTheWords
      required: false
      schema:
        type: string
    _notTheWords:
      description: >
        Performs fuzzy matching on all fuzzy-matchable search fields and exact
        matching on all

        exact-matchable search fields, and ensure that entries matching that
        search will not

        appear in results.


        For example, `_notTheWords=Rob` will match a `firstName` of `Robby` a
        `lastName` of

        `Roberts` and street address of `123 Robinson Dr` and ensure those
        results are not

        included in results.
      in: query
      name: _notTheWords
      required: false
      schema:
        type: string
    address:
      description: >
        Fuzzy matches addresses associated with a borrower. For example
        `address=fake` will match an

        `addressLine1` of `123 Fake St` as well as a city of `Fakeville`.


        Note that states are stored as their abbreviations, so you *must* search
        with

        the abbreviation to match. For example, `address=MO` will match
        Missouri, but

        `address=Missouri` will not.
      in: query
      name: address
      required: false
      schema:
        type: string
    bankruptcyCourtCase:
      description: |
        Exactly matches a bankruptcy court case ID.
      in: query
      name: bankruptcyCourtCase
      required: false
      schema:
        type: string
    businessName:
      description: >
        Fuzzy matches the `businessName` or `businessLegalName` of business
        borrowers—never matches a person.
      in: query
      name: businessName
      required: false
      schema:
        type: string
    components-parameters-caseId:
      description: >
        Exactly matches a case ID. Can be either the Peach ID (like
        `CS-XXXX-XXXX`) or

        the external ID.
      in: query
      name: caseId
      required: false
      schema:
        type: string
    city:
      description: |
        Fuzzy match the city in any of a borrower's addresses.
      in: query
      name: city
      required: false
      schema:
        type: string
    dateOfBirth:
      description: |
        Exactly matches a borrower's date of birth. Specified like `YYYY-MM-DD`.
      in: query
      name: dateOfBirth
      required: false
      schema:
        format: date
        type: string
    email:
      description: |
        Fuzzy matches any of a borrower's email addresses.
      in: query
      name: email
      required: false
      schema:
        type: string
    emailExact:
      description: |
        Exactly matches any of a borrower's email addresses.
      in: query
      name: emailExact
      required: false
      schema:
        type: string
    employeeEmail:
      description: |
        Fuzzy matches any of a business borrower's employees' email addresses.
      in: query
      name: employeeEmail
      required: false
      schema:
        type: string
    employeeEmailExact:
      description: |
        Exactly matches any of a business borrower's employees' email addresses.
      in: query
      name: employeeEmailExact
      required: false
      schema:
        type: string
    employeePhone:
      description: >
        Exactly matches any of a business borrower's employees' phone numbers.


        Note that Peach currently only supports US phone numbers.


        You may search with any US phone number format. For example
        `(570)123-1234`, `+15701231234`

        are all treated as identical `570-123-1234` numbers.
      in: query
      name: employeePhone
      required: false
      schema:
        type: string
    employeeName:
      description: >
        Fuzzy matches a business borrower's employee's name. This will never
        match a person borrower.
      in: query
      name: employeeName
      required: false
      schema:
        type: string
    firstName:
      description: |
        Fuzzy matches a borrower's first name.
      in: query
      name: firstName
      required: false
      schema:
        type: string
    firstNamePartial:
      description: >
        Exactly matches a substring of the borrower's first name.


        For example, if a borrower's first name were 'William',

        - `firstNamePartial=Will` would match because it is exactly contained in
        the first name.

        - `firstNamePartial=lia` would match because it is exactly contained in
        the first name.

        - `firstNamePartial=Bill` would NOT match because, while close, it is
        not exactly contained in the first name.
      in: query
      name: firstNamePartial
      required: false
      schema:
        type: string
    fullName:
      description: >
        Fuzzy matches all parts of a borrower's full name. (If the borrower is a
        business this will also

        match against the business name and business legal name.)
      in: query
      name: fullName
      required: false
      schema:
        type: string
    incorporatedState:
      description: |
        Exactly matches the `incorporatedState` of business borrowers.
      in: query
      name: incorporatedState
      required: false
      schema:
        type: string
    id:
      description: >
        Exactly matches a borrower's ID. Can be either the Peach ID (like
        `BO-XXXX-XXXX`) or

        the external ID.
      in: query
      name: id
      required: false
      schema:
        type: string
    components-parameters-interactionId:
      description: |
        Exactly matches the ID of an interaction sent to or receieved from the
        borrower. Can be either the Peach ID (like `IN-XXXX-XXXX`) or the
        external ID.
      example: IN-1234-ABCD
      in: query
      name: interactionId
      required: false
      schema:
        type: string
    lastName:
      description: |
        Fuzzy matches a borrower's last name.
      in: query
      name: lastName
      required: false
      schema:
        type: string
    lastNamePartial:
      description: |
        Exactly matches a substring of the borrower's last name, following the
        same rules as for `firstNamePartial`.
      in: query
      name: lastNamePartial
      required: false
      schema:
        type: string
    legalRepFirstName:
      description: |
        Fuzzy match the first name of any of a borrower's legal representatives.
      in: query
      name: legalRepFirstName
      required: false
      schema:
        type: string
    legalRepLastName:
      description: |
        Fuzzy match the last name of any of a borrower's legal representatives.
      in: query
      name: legalRepLastName
      required: false
      schema:
        type: string
    legalRepEmail:
      description: |
        Fuzzy match any email of any of a borrower's legal representatives.
      in: query
      name: legalRepEmail
      required: false
      schema:
        type: string
    legalRepPhone:
      description: >
        Exactly match any phone number of any of a borrower's legal
        representatives.


        Note that Peach currently only supports US phone numbers.


        You may search with any US phone number format. For example
        `(570)123-1234`, `+15701231234`

        are all treated as identical `570-123-1234` numbers.
      in: query
      name: legalRepPhone
      required: false
      schema:
        type: string
    parameters-loanId:
      description: >
        Exactly matches a loan's ID. Can be either the Peach ID (like
        `LN-XXXX-XXXX`) or

        the external ID.
      example: LN-1234-ABCD
      in: query
      name: loanId
      required: false
      schema:
        type: string
    loanIdPartial:
      description: >
        Exactly matches a substring of the loan's external ID.


        For example, if a loan's external ID were
        `6eeab840-3cbc-4c40-a19b-df3e9c040a54`,

        - `loanIdPartial=6eeab840` would match because it is exactly contained
        in the external ID.

        - `loanIdPartial=cbc-4c40-a1` would match because it is exactly
        contained in the external ID.

        - `loanIdPartial=9bdf3e` would NOT match because, while close, it is not
        exactly contained in the external ID.
      example: null
      in: query
      name: loanIdPartial
      required: false
      schema:
        type: string
    maidenName:
      description: |
        Fuzzy matches a borrower's maiden name.
      in: query
      name: maidenName
      required: false
      schema:
        type: string
    maidenNamePartial:
      description: |
        Exactly matches a substring of the borrower's maiden name, following the
        same rules as for `firstNamePartial`.
      in: query
      name: maidenNamePartial
      required: false
      schema:
        type: string
    middleName:
      description: |
        Fuzzy matches a borrower's middle name.
      in: query
      name: middleName
      required: false
      schema:
        type: string
    middleNamePartial:
      description: |
        Exactly matches a substring of the borrower's middle name, following the
        same rules as for `firstNamePartial`.
      in: query
      name: middleNamePartial
      required: false
      schema:
        type: string
    paymentMethod:
      description: >
        Exactly match the last four digits of the borrower's payment methods on
        file.
      in: query
      name: paymentMethod
      required: false
      schema:
        type: string
    phone:
      description: >
        Exactly matches any of a borrower's phone numbers.


        Note that Peach currently only supports US phone numbers.


        You may search with any US phone number format. For example
        `(570)123-1234`, `+15701231234`

        are all treated as identical `570-123-1234` numbers.
      in: query
      name: phone
      required: false
      schema:
        type: string
    postalCode:
      description: |
        Exactly match the postal code in any of a borrower's addresses.
      in: query
      name: postalCode
      required: false
      schema:
        type: string
    state:
      description: >
        Exactly match the state (as an abbreviation) for any of a borrower's
        addresses.


        Note that the full name of a state will NOT match.
      in: query
      name: state
      required: false
      schema:
        type: string
    taxId:
      description: >
        Exactly matches the last four digits of any of the borrower's tax ID
        document numbers.

        The Tax ID document is either a Social Security Number (SSN), an
        Individual Taxpayer

        Identification Number (ITIN), or a passport number.
      in: query
      name: taxId
      required: false
      schema:
        type: string
    _forceIndex:
      description: >
        For testing new search systems before wider deploy, specify the index to
        use for searching.
      in: query
      name: _forceIndex
      required: false
      schema:
        type: string
    includeIdentity:
      description: >
        If set to true, includes the primary identity of the borrower. Use of
        this flag requires the `person:read.sensitive` permission.
      in: query
      name: includeIdentity
      schema:
        default: false
        type: boolean
    removeObjectType:
      description: |
        Type of object to remove from the case.
      in: query
      name: objectType
      required: true
      schema:
        enum:
          - document
          - case
          - interaction
          - loan
          - transaction
        type: string
    removeObjectId:
      description: >-
        Peach unique identifier for the associated object to remove from the
        case.
      example: LN-AAAA-BBBB
      in: query
      name: objectId
      required: true
      schema:
        type: string
    relation:
      description: >
        Label for a relationship between entities. Both `causes` and `blocks`
        are assumed to be directional, while the

        generic `related` is non-directional,
      in: query
      name: relation
      required: false
      schema:
        default: related
        enum:
          - causes
          - blocks
          - duplicate
          - related
        type: string
    doNotInteractId:
      description: |
        The Do Not Interact object unique identifier.
      in: path
      name: doNotInteractId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    caseEscalationId:
      description: The case escalation object unique identifier.
      in: path
      name: caseEscalationId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    caseIdQuery:
      description: |
        Optional case ID to be recorded with the change.
      in: query
      name: caseId
      schema:
        $ref: '#/components/schemas/AnyId'
    contactCollidesWithEmail:
      description: |
        Filters for contacts which would collide with this email if it were used
        to create a new borrower contact.
      in: query
      name: collidesWithEmail
      required: false
      schema:
        type: string
    contactCollidesWithPhone:
      description: >
        Filters for contacts which would collide with this phone number if it
        were used

        to create a new borrower contact.
      in: query
      name: collidesWithPhone
      required: false
      schema:
        type: string
    contactType:
      description: The contact type to filter by.
      in: query
      name: contactType
      required: false
      schema:
        $ref: '#/components/schemas/ContactType'
    contactAffiliation:
      description: The contact affiliation to filter by.
      in: query
      name: affiliation
      schema:
        $ref: '#/components/schemas/ContactAffiliation'
    contactLabel:
      description: The contact label to filter by.
      in: query
      name: label
      schema:
        $ref: '#/components/schemas/ContactLabel'
    contactStatus:
      description: The contact status to filter by.
      in: query
      name: status
      schema:
        $ref: '#/components/schemas/ContactStatus'
    contactIncludeArchived:
      description: Include archived contacts into the result.
      in: query
      name: includeArchived
      schema:
        default: false
        type: boolean
    contactIncludeLegal:
      description: |
        Whether to include legal representation contact objects.
      in: query
      name: includeLegal
      schema:
        default: true
        type: boolean
    receiveTextMessages:
      description: >-
        If passed, only returns contacts with receiveTextMessages set to that
        value.
      in: query
      name: receiveTextMessages
      required: false
      schema:
        type: boolean
    contactValue:
      description: The value of the contact to filter by.
      in: query
      name: value
      schema:
        type: string
    powerOfAttorney:
      description: >-
        If passed, only returns contacts with `powerOfAttorney` set to that
        value.
      in: query
      name: powerOfAttorney
      required: false
      schema:
        type: boolean
    authorizedThirdParty:
      description: >-
        If passed, only returns contacts with `authorizedThirdParty` set to that
        value.
      in: query
      name: authorizedThirdParty
      required: false
      schema:
        type: boolean
    confirmationCode:
      description: The previously emailed or texted confirmation code.
      in: query
      name: confirmationCode
      required: false
      schema:
        pattern: ^\d{6}$
        type: string
    contactId:
      description: The contact ID.
      in: path
      name: contactId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    documentUploadLinkId:
      description: |
        The doc upload link ID. Used for identifying the resource in the API.
        Not to be confused with the `documentUploadLinkKey`.
      in: path
      name: documentUploadLinkId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    DeleteSource:
      description: |
        When `true`, set `deletedAt` on the source document to the current
        time. This prevents it from appearing in future get documents requests.
      in: query
      name: deleteSource
      schema:
        default: false
        type: boolean
    includeArchivedIdentities:
      description: |
        If set to true, includes archived identities
      in: query
      name: includeArchived
      schema:
        default: false
        type: boolean
    personIdentityId:
      description: |
        An identity's unique identifier.
      in: path
      name: personIdentityId
      required: true
      schema:
        type: string
    interactionsSortBy:
      description: >
        The field(s) to sort by.


        All fields can be prefixed with a `-` to indicate the sort should be in
        descending order,

        or with a `+` to indicate the sort should be in ascending order.
        (Without specifying

        the order is descending.)


        The valid sort by field names are:


        `id` — order by the object creation order.

        `createdAt` — order by the `createdAt` field.

        `startedAt` — order by the `startedAt` field.

        `holdDuration` — order by the duration of the voice call on-hold (the
        `holdDuration` field.)

        `contactName` — order by the `name` field of the contact for the
        interaction.

        `scheduledAtFrom` — order by the `scheduledAtFrom` field.

        `scheduledAtTo` — order by the `scheduledAtTo` field.

        `channel` — order by the `channel` field.

        `direction` — order by the `direction` field.

        `status` — order by the `status` field.

        `createdBy.employeeFirstName` — order by the `firstName` field of the
        employee which created the interaction (only if creator was an
        employee).

        `createdBy.employeeLastName` — order by the `lastName` field of the
        employee which created the interaction (only if creator was an
        employee).

        `createdBy.employeeEmail` — order by the `email` field of the employee
        which created the interaction (only if creator was an employee).

        `createdBy.employeeDisplayName` - order by the full name (`{firstName}
        {lastName}`) or, if absent, the `email` of the employee whihch created
        the interaction (only if creator was an employee).

        `createdBy.employeeFullNameOrEmail` — **DEPRECATED** alias for
        `createdBy.employeeDisplayName`
      in: query
      name: sortBy
      required: false
      schema:
        items:
          type: string
        type: array
    legalRepresentativeId:
      description: |
        The legal representative object unique identifier.
      in: path
      name: legalRepresentativeId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    filterLoanStatus:
      in: query
      name: status
      required: false
      schema:
        items:
          enum:
            - all
            - active
            - pending
            - originated
            - declined
            - frozen
            - accelerated
            - chargedOff
            - paidOff
            - canceled
          type: string
        type: array
    chargeOffBalance:
      description: >
        This filter is only applicable if `chargedOff` is one of the statuses.

        In other words, this filter will only be applied on loans with
        `status=chargedOff`.


        `all` - all `chargedOff` loans will be returned (honoring other
        filters).


        `hasBalance` - only `chargedOff` loans with outstanding balance greater
        than zero will be returned.


        `zeroBalance` - only `chargedOff` loans with zero outstanding balance
        will be returned.
      in: query
      name: chargeOffBalance
      required: false
      schema:
        enum:
          - all
          - hasBalance
          - zeroBalance
        type: string
    forceLoanUpdate:
      description: |
        Override that enables the update of a borrower's address of a loan.
      in: query
      name: force
      schema:
        default: false
        type: boolean
    syncGeneric:
      description: Make the process synchronous.
      in: query
      name: sync
      schema:
        default: false
        type: boolean
    advanceStatus:
      description: The status of the advances.
      in: query
      name: status
      schema:
        enum:
          - scheduled
          - pending
          - settled
          - canceled
        type: string
    advanceId:
      description: The advance identifier.
      in: path
      name: advanceId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    autopayExpectedPaymentStatus:
      description: >
        The comma separated list of `status` values of autopay expected payments
        to include in the results, which are merged by date.

        All autopay expected payments can still be accessed in the
        `individualEntries` field.
      explode: false
      in: query
      name: statuses
      schema:
        default:
          - booked
          - modified
        items:
          enum:
            - booked
            - skipped
            - canceled
            - modified
            - draft
            - processed
          type: string
        type: array
      style: form
    autopayCancellationReason:
      description: |
        The cancellation reason.
      in: query
      name: cancellationReason
      required: false
      schema:
        default: canceledByUser
        enum:
          - invalidPaymentMethod
          - paymentMethodRemoved
          - tooManyFailedAttempts
          - loanFrozen
          - loanAccelerated
          - loanChargedOff
          - loanPaidOff
          - canceledByUser
          - loanTermsChanged
        type: string
    isRounded:
      description: If true, balances will be rounded to the closes 1 cent.
      in: query
      name: isRounded
      schema:
        type: boolean
    skipYtd:
      description: If true, skip year-to-date calculations.
      in: query
      name: skipYtd
      schema:
        type: boolean
    fast:
      description: >
        Perform a faster query that returns a pre-defined subset of attributes.
        When this query parameter is used, the `toEffectiveAt`

        parameter is ignored and only real-time balances are returned.


        To configure the subset of attributes, please contact the Peach team.
      in: query
      name: fast
      schema:
        default: false
        type: boolean
    toEffectiveDate:
      description: Last day for which to fetch balances
      in: query
      name: toEffectiveDate
      schema:
        format: date
        type: string
    forceLoanCancel:
      description: >
        Override that enables the cancellation of active loans not managed by
        Peach. Requires the `loan:cancel.force` permission.

        Forced cancellation should only be used for testing purposes.
      in: query
      name: force
      schema:
        default: false
        type: boolean
    clearAllExternalIdsLoanCancel:
      description: >
        If `true`, will clear all related loan, draws (if LOC), purchases (if
        LOC), transactions, and dynamic fees external IDs. This will emit a
        `externalid.changed` event for all impacted objects.


        NOTE: If `sync=true`, there is a max limit of 1000 external IDs that can
        be cleared synchronously.

        If there are more than 1000, the request will fail with a HTTP 408
        status code. You should instead set `clearAllExternalIds=false` and call
        the individual endpoints to clear external IDs.
      in: query
      name: clearAllExternalIds
      schema:
        default: false
        type: boolean
    syncLoanCancel:
      description: >
        Today, `sync` only controls the clearing of external IDs when cancelling
        a loan when `clearAllExternalIds` is `true`.


        `true` - Clears the external IDs of the loan, draws, purchases,
        transactions, and dynamic fees up to the max limit of 1000.

        If there are more than 1000, the request will fail with a HTTP 408
        status code.


        `false` - will clear all external IDs asynchronously. This is not yet
        supported.
      in: query
      name: sync
      schema:
        default: true
        type: boolean
    clearExternalIdGeneric:
      description: |
        If `true`, will clear the external ID for the object.
      in: query
      name: clearExternalId
      schema:
        default: false
        type: boolean
    showPan:
      description: >-
        Set to `true` to get the full PAN in the response. Special permission is
        required.
      in: query
      name: showPan
      required: false
      schema:
        type: boolean
    showCvv:
      description: >-
        Set to `true` to get the full CVV2 number in the response. Special
        permission is required.
      in: query
      name: showCvv
      required: false
      schema:
        type: boolean
    refresh:
      description: >
        If `true`, the Peach system will make new API calls to the card issuer
        to get the most recent card details and balances,

        and will store the new details in the Peach database. Otherwise, the
        Peach system will return the most recent details from its database.
      in: query
      name: refresh
      required: false
      schema:
        type: boolean
    cardStatusFilter:
      description: |
        Filter cards by status. Accepts a single value or a comma-separated list
        (e.g. `?status=blocked` or `?status=blocked,closed`).
      explode: false
      in: query
      name: status
      required: false
      schema:
        type: string
      style: form
    cardId:
      description: The ID of the card. Can be Peach or lender's external identifier.
      in: path
      name: cardId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    servicedBy:
      in: query
      name: servicedBy
      required: true
      schema:
        $ref: '#/components/schemas/LoanServicer'
    effectiveDate:
      in: query
      name: effectiveDate
      schema:
        format: date
        type: string
    customPaymentPlanStatusQuery:
      description: >
        Use this to filter a search for custom payment plans that are `active`,
        `inactive` or `canceled`.
      in: query
      name: status
      schema:
        enum:
          - active
          - inactive
          - canceled
        type: string
    paymentPlanId:
      description: The identifier of the payment plan.
      in: path
      name: paymentPlanId
      required: true
      schema:
        type: string
    cardIds:
      description: >
        Filter results to disputes whose underlying purchase is linked to one of
        these cards.

        Accepts Peach `CD-...` IDs and external `ext-...` IDs. Unresolvable IDs
        are ignored.
      in: query
      name: cardIds
      required: false
      schema:
        items:
          $ref: '#/components/schemas/AnyId'
        type: array
    isClosed:
      description: Filter for draws with `isClosed` value
      in: query
      name: isClosed
      required: false
      schema:
        type: boolean
    isAmortized:
      description: Filter for amortized or non-amortized draws
      in: query
      name: isAmortized
      required: false
      schema:
        type: boolean
    startedBefore:
      description: Filter for draws started before a date
      in: query
      name: startedBefore
      required: false
      schema:
        format: date
        type: string
    drawId:
      description: The draw identifier.
      in: path
      name: drawId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    skipInterestAccrual:
      description: If true, skip automatic interest accrual to catch up if it is missing.
      in: query
      name: skipInterestAccrual
      schema:
        type: boolean
    effectiveRatesPeriodIdsQuery:
      description: >
        List of period IDs to specify the requested dates.


        This is an alternative to using `fromDate` and `toDate` to specify the
        requested dates;

        instead of specifying a range of dates, every date falling within all

        of the specified periods will be returned. Note this might result in
        non-consecutive dates.


        Cannot be used in conjunction with `fromDate` or `toDate`.
      in: query
      name: periodIds
      schema:
        items:
          type: string
        type: array
    effectiveRatesPeriodDueDatesQuery:
      description: >
        List of period due dates to specify the requested dates.


        This is an alternative to specifying the periods of concern with IDs and
        instead

        referencing them by their due dates.


        This is also an alternative to using `fromDate` and `toDate` to specify
        the requested dates;

        instead of specifying a range of dates, every date falling within all

        of the specified periods will be returned. Note this might result in
        non-consecutive dates.


        Cannot be used in conjunction with `fromDate` or `toDate`.
      in: query
      name: periodDueDates
      schema:
        items:
          format: date
          type: string
        type: array
    obligationStatusQuery:
      description: >
        Use this to filter a search for obligations that are `unfulfilled` or
        `overdue`.
      in: query
      name: status
      schema:
        enum:
          - unfulfilled
          - overdue
        type: string
    loanPeriodFromDate:
      description: >
        The first date in the range to return.

        The system will return any period for which period's `startDate` -
        `endDate` fully or partially overlap with `fromDate` - `toDate` range.

        Both `fromDate` and `toDate` must be passed to get all periods in the
        range.
      in: query
      name: fromDate
      required: false
      schema:
        format: date
        type: string
    loanPeriodToDate:
      description: >
        The last date in the range to return.

        The system will return any period for which period's `startDate` -
        `endDate` fully or partially overlap with `fromDate` - `toDate` range.

        Both `fromDate` and `toDate` must be passed to get all periods in the
        range.
      in: query
      name: toDate
      schema:
        format: date
        type: string
    dueDate:
      description: >
        The due date of the period. The system will return the object
        corresponding to the period with due date equal to `dueDate`.

        If no matching period is found, the system will return no results.
      in: query
      name: dueDate
      schema:
        format: date
        type: string
    isOpen:
      description: >
        `true` means that the obligation is still "open" and the
        `obligationAmount` is not final. The obligation amount can potentially
        change until the

        period ends. `false` means that the obligation is "sealed" and the
        `obligationAmount` is final.
      in: query
      name: isOpen
      schema:
        type: boolean
    obligationId:
      description: The obligation object unique identifier.
      in: path
      name: obligationId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    promoProgramId:
      description: The promotional program identifier.
      in: path
      name: promoProgramId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    promoCancelReason:
      description: |
        The cancellation reason.

          `expired` - the promo expired.

          `disqualified` - the promo was disqualified for various
          reasons.

          `borrowerOptedOut` - the borrower decided to opt out from the
          promotional program.

          `adminError` - the promo program was added by mistake.
      in: query
      name: promoCancelReason
      required: false
      schema:
        $ref: '#/components/schemas/PromoCancelReason'
    purchaseTypes:
      description: The statuses of the purchases to fetch
      in: query
      name: types
      required: false
      schema:
        items:
          enum:
            - regular
            - refund
            - cashback
          type: string
        type: array
    purchaseStatuses:
      description: The statuses of the purchases to fetch
      in: query
      name: statuses
      required: false
      schema:
        items:
          enum:
            - authorized
            - pending
            - settled
            - canceled
            - declined
            - disputed
          type: string
        type: array
    parameters_cardIds:
      description: |
        Filter purchases by one or more card identifiers. Each value can be a
        Peach public id (`CD-...`) or an external id (`ext-...`).
        Unresolvable ids are silently ignored; if no ids resolve the result
        set is empty. Omit the param for no filtering.
      in: query
      name: cardIds
      required: false
      schema:
        items:
          $ref: '#/components/schemas/AnyId'
        type: array
    fromEffectiveAt:
      description: >-
        Used for filtering objects such that `effectiveAt` is greater than or
        equal to `fromEffectiveAt`
      in: query
      name: fromEffectiveAt
      schema:
        format: date-time
        type: string
    toEffectiveAt:
      description: >-
        Used for filtering objects such that `effectiveAt` is less than or equal
        to `toEffectiveAt`
      in: query
      name: toEffectiveAt
      schema:
        format: date-time
        type: string
    fromCreatedAt:
      description: >-
        Used for filtering objects such that `createdAt` is greater than or
        equal to `fromCreatedAt`
      in: query
      name: fromCreatedAt
      schema:
        format: date-time
        type: string
    toCreatedAt:
      description: >-
        Used for filtering objects such that `createdAt` is less than or equal
        to `toCreatedAt`
      in: query
      name: toCreatedAt
      schema:
        format: date-time
        type: string
    sortByEffectiveAt:
      description: The data attributes by which to sort the results.
      in: query
      name: sortBy
      required: false
      schema:
        items:
          enum:
            - effectiveAt
            - +effectiveAt
            - '-effectiveAt'
            - createdAt
            - +createdAt
            - '-createdAt'
          type: string
        type: array
    forcePurchaseOverCreditLimit:
      description: >
        Allows creating or updating purchases, even if:

        - The purchase amount pushes the line or draw above the credit limit.

        - The line or draw `isClosed=true`.


        If `force=true` is passed, the `forceOverLimit` and `forceIfClosed`
        parameters are ignored.


        Requires the `draw.purchase:force` permission.
      in: query
      name: force
      schema:
        default: false
        type: boolean
    forceOverLimit:
      description: >
        Allows creating or updating purchases even if the purchase amount pushes
        the line or draw above the credit limit.

        Requires the `draw.purchase:force` permission.

        If `force=true` is passed, this parameter is ignored.
      in: query
      name: forceOverLimit
      schema:
        default: false
        type: boolean
    forceIfClosed:
      description: >
        Allows creating or updating purchases even if the line or draw
        `isClosed=true`.

        Requires the `draw.purchase:force` permission.

        If `force=true` is passed, this parameter is ignored.
      in: query
      name: forceIfClosed
      schema:
        default: false
        type: boolean
    timelineOrdering:
      description: >
        The parameters used to generate a timeline of purchases. Purchases will
        be inserted into the timeline based on the parameters provided.

        `effectiveAt`, `createdAt`, and `authorizedAt` are available for
        sorting. `createdAt` will be used if any purchases would not be inserted

        into the timeline based on the attributes provided. The full timeline
        will be sorted either ASC (`+`) or DESC (`-`). It cannot be sorted

        based on individual attributes. e.g. [-effectiveAt, +authorizedAt,
        -createdAt] is not a valid input.
      in: query
      name: timelineOrdering
      required: false
      schema:
        items:
          enum:
            - effectiveAt
            - authorizedAt
            - createdAt
          type: string
        type: array
    timelineSortOrder:
      description: |
        The order of the purchase timeline returned.
        - `asc` - oldest to newest
        - `desc` - newest to oldest
      in: query
      name: sortOrder
      required: false
      schema:
        enum:
          - asc
          - desc
        type: string
    purchaseId:
      description: The purchase identifier.
      in: path
      name: purchaseId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    purchaseDisputeId:
      description: The ID of the purchase dispute
      in: path
      name: purchaseDisputeId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    rateCapId:
      description: |
        The unique identifier of the Rate Cap we wish to retrieve.
      in: path
      name: rateCapId
      required: true
      schema:
        $ref: '#/components/schemas/RateCapId'
    rateId:
      description: |
        Unique identifier of an interest or promo rate.
      in: path
      name: rateId
      required: true
      schema:
        type: string
    includeDraws:
      description: |
        If set to true, includes the fees on all draws on the line of credit.
      in: query
      name: includeDraws
      schema:
        default: true
        type: boolean
    loanFeeId:
      description: The loan fee identifier.
      in: path
      name: loanFeeId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    syncUpdateDynamicFee:
      description: >-
        Make the process synchronous. Only relevant for `originalAmount`
        updates. Updating this value will trigger a replay.
      in: query
      name: sync
      schema:
        default: false
        type: boolean
    fromEffectiveDate:
      description: Last day for which to fetch balances
      in: query
      name: fromEffectiveDate
      schema:
        format: date
        type: string
    scraRateId:
      description: |
        Unique identifier of the SCRA interest rate to update or delete.
      in: query
      name: rateId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    locScraSendNotice:
      deprecated: true
      description: >
        Deprecated. This parameter is accepted for backwards compatibility but
        has no effect.

        Notices are always sent.
      in: query
      name: sendNotice
      required: false
      schema:
        default: true
        type: boolean
    scraCaseId:
      description: The case object unique identifier.
      in: query
      name: caseId
      required: false
      schema:
        $ref: '#/components/schemas/AnyId'
    dueDateGet:
      description: >
        The due date of the period. The system will return the object
        corresponding to the period with

        due date equal to `dueDate`. If no matching period is found, the system
        will return no results.
      in: query
      name: dueDate
      required: false
      schema:
        format: date
        type: string
    reportingToAgency:
      description: Filters to only loan types set up to report to this agency.
      in: query
      name: reportingToAgency
      schema:
        enum:
          - experian
          - equifax
          - transUnion
          - innovis
        type: string
    dueDateUpdate:
      description: >
        The due date of the period. The system will update the object
        corresponding to the period with

        a due date equal to `dueDate`. If no matching period is found, the
        system will not make any updates.
      in: query
      name: dueDate
      required: true
      schema:
        format: date
        type: string
    dueDateDelete:
      description: >
        The due date of the period. The system will delete the object
        corresponding to the period with

        a due date equal to `dueDate`. If no matching period is found, the
        system will not make any updates.
      in: query
      name: dueDate
      required: true
      schema:
        format: date
        type: string
    transactionStatuses:
      in: query
      name: status
      required: false
      schema:
        items:
          $ref: '#/components/schemas/TransactionStatusReadOnly'
        type: array
    queryPaymentInstrumentId:
      description: The payment instrument identifier.
      in: query
      name: paymentInstrumentId
      schema:
        $ref: '#/components/schemas/AnyId'
    transactionType:
      in: query
      name: transactionType
      required: false
      schema:
        enum:
          - payment
          - serviceCredit
        type: string
    serviceCreditTypes:
      in: query
      name: serviceCreditTypes
      required: false
      schema:
        items:
          $ref: '#/components/schemas/serviceCreditTypes'
        type: array
    toEffectiveDateGeneric:
      description: Last day for which an object's effective date must match
      in: query
      name: toEffectiveDate
      schema:
        format: date
        type: string
    fromEffectiveDateGeneric:
      description: First day for which an object's effective date must match
      in: query
      name: fromEffectiveDate
      schema:
        format: date
        type: string
    sortByForTransactions:
      description: The data attributes by which to sort the results.
      in: query
      name: sortBy
      required: false
      schema:
        items:
          enum:
            - appliedAt
            - +appliedAt
            - '-appliedAt'
            - createdAt
            - +createdAt
            - '-createdAt'
            - effectiveDate
            - +effectiveDate
            - '-effectiveDate'
            - displayDate
            - +displayDate
            - '-displayDate'
          type: string
        type: array
    transactionId:
      description: Transaction ID. Can be Peach or lender's external identifier.
      in: path
      name: transactionId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    scraSendNotice:
      description: >
        When set to `false`, the system will NOT send a
        `loanPaymentScheduleChanged` notice to the borrower.


        Note: Changing the loan terms will automatically cancel an existing
        Autopay (if enabled). A borrower,  an agent or

        API caller needs to turn on / enable a new Autopay plan after the loan
        terms change is completed. If the loan has Autopay enabled:
         - When `sendNotice=false`, the system will NOT send an `autopayCanceledBySystem` notice.
         - When `sendNotice=true`, the system will send an `autopayCanceledBySystem` notice in addition to the applicable loan terms notice.
      in: query
      name: sendNotice
      required: false
      schema:
        default: true
        type: boolean
    loanPeriodId:
      description: The identifier of the period.
      in: path
      name: loanPeriodId
      required: true
      schema:
        type: string
    periodId:
      description: The identifier of the period.
      in: path
      name: periodId
      required: true
      schema:
        type: string
    sendNotice:
      description: >
        When set to `true`, the system will send a `statementGenerated` notice
        to the borrower.
      in: query
      name: sendNotice
      schema:
        default: false
        type: boolean
    statementReason:
      description: Reason for manually generating statement.
      in: query
      name: reason
      required: false
      schema:
        type: string
    parameters-status:
      description: >
        Filter by status. Possible values are `scheduled`, `active`, `kept`,
        `broken`, `canceled`.
      explode: true
      in: query
      name: status
      schema:
        items:
          enum:
            - scheduled
            - active
            - kept
            - broken
            - canceled
          type: string
        type: array
      style: form
    isOverdue:
      description: |
        Filter by overdue status. Possible values are `true`, `false`.
      in: query
      name: isOverdue
      schema:
        enum:
          - true
          - false
        type: boolean
    startDateAfter:
      description: |
        Filter by start date after. Format: `YYYY-MM-DD`.
      in: query
      name: startDateAfter
      schema:
        format: date
        type: string
    endDateBefore:
      description: |
        Filter by end date before. Format: `YYYY-MM-DD`.
      in: query
      name: endDateBefore
      schema:
        format: date
        type: string
    promoEffectiveEndDateAfter:
      description: >-
        Return promo programs with a `promoEffectiveEndDate` starting after the
        provided date.
      in: query
      name: promoEffectiveEndDateAfter
      schema:
        format: date
        type: string
    statuses:
      description: >
        The array of statuses used for filtering if a borrower has promo
        programs with the given `status`. If not 

        passed, by default we return all statuses
      in: query
      name: statuses
      schema:
        items:
          enum:
            - pending
            - active
            - exercised
            - canceled
          type: string
        type: array
    loanRefundId:
      description: The loan refund identifier.
      in: path
      name: loanRefundId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    statementYear:
      description: Only return statements from the current year.
      in: query
      name: year
      schema:
        type: string
    includeAllVersions:
      description: >
        A flag to determine if all template versions should be returned, not
        just the most recent / active ones.
      in: query
      name: includeAllVersions
      schema:
        default: false
        type: boolean
    includeTestVersions:
      description: >
        A flag to determine whether test versions should be returned. If this
        flag is set to "true",

        the system will ignore the `includeAllVersions` attribute and return
        only test versions.
      in: query
      name: includeTestVersions
      schema:
        default: false
        type: boolean
    statementPubId:
      description: The statement object unique identifier.
      in: path
      name: statementId
      required: true
      schema:
        pattern: ^[A-Z][A-Z0-9]-[A-Z0-9]+-[A-Z0-9]+|^\d+$
        type: string
    parameters_isExternal:
      description: Fetch entities that are marked external.
      in: query
      name: isExternal
      schema:
        type: boolean
    isVirtual:
      in: query
      name: isVirtual
      required: false
      schema:
        type: boolean
    paymentReason:
      in: query
      name: paymentReason
      required: false
      schema:
        enum:
          - autoPay
          - settlement
          - reversal
          - downPayment
          - oneTimePayment
          - reimbursement
        type: string
    retryOriginalTransactionId:
      in: query
      name: retryOriginalTransactionId
      required: false
      schema:
        type: string
    transactionCancelReason:
      in: query
      name: cancelReason
      required: false
      schema:
        $ref: '#/components/schemas/TransactionCancelReason'
    chargebackId:
      description: Chargeback ID. Can be Peach or lender's external identifier.
      in: path
      name: chargebackId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    parameters_includeDeleted:
      description: Include entities that are marked deleted.
      in: query
      name: includeDeleted
      schema:
        default: false
        type: boolean
    showFullAccountNumber:
      description: >
        Provide raw untokenized account details:

        `cardNumber` for cards, `accountNumber` for bank accounts, checks,
        wires, and money orders.


        Requires the `payment.instrument:read.sensitive` permission.
      in: query
      name: showFullAccountNumber
      schema:
        default: false
        type: boolean
    forcePaymentInstrument:
      description: >
        Overrides the results of BIN / Routing Number lookup. Requires the
        `payment.instrument:force` permission.
      in: query
      name: force
      schema:
        default: false
        type: boolean
    sync:
      description: >
        Make the payment instrument authentication process synchronous. Only
        relevant for cards.
      in: query
      name: sync
      schema:
        default: false
        type: boolean
    allowDuplicates:
      description: >
        For external payment instruments, skip duplicate checks. Allows the
        creation two external payment instruments with the same last 4 digits on
        the same borrower.
      in: query
      name: allowDuplicates
      schema:
        default: false
        type: boolean
    paymentInstrumentId:
      description: The payment instrument identifier.
      in: path
      name: paymentInstrumentId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    verificationStatus:
      description: >
        The comma separated list of `status` values of verifications to include
        in the response.

        If not included, include all verifications.
      explode: false
      in: query
      name: status
      schema:
        items:
          type: string
        type: array
      style: form
    dryRun:
      description: >
        If `true`, then return successfully if the operation would complete
        successfully, but do not

        actually save the changes which would result from this operation.
      in: query
      name: dryRun
      schema:
        default: false
        type: boolean
    verificationId:
      description: |
        The borrower verification unique identifier.
      in: path
      name: verificationId
      required: true
      schema:
        type: string
    supercaseSortBy:
      description: The attribute by which to sort the results.
      in: query
      name: sortBy
      required: false
      schema:
        items:
          enum:
            - '-id'
            - id
            - +id
            - '-createdAt'
            - createdAt
            - +createdAt
            - '-name'
            - name
            - +name
            - '-status'
            - status
            - +status
          type: string
        type: array
    supercaseType:
      description: The type of the supercase
      in: query
      name: supercaseType
      schema:
        $ref: '#/components/schemas/SupercaseType'
        default: generic
    femaDisasterNumber:
      in: query
      name: femaDisasterNumber
      schema:
        type: integer
    statusFilter:
      in: query
      name: status
      schema:
        items:
          $ref: '#/components/schemas/ProcessStatus'
        type: array
    components-parameters-supercaseId:
      description: The ID of the supercase
      in: path
      name: supercaseId
      required: true
      schema:
        type: string
    operationTypes:
      description: |
        List of desired operation types.
      in: query
      name: operationTypes
      required: false
      schema:
        items:
          enum:
            - update
            - sendMessage
            - createDoNotInteract
            - deleteDoNotInteract
            - sendInstructionsByTask
          type: string
        type: array
    supercaseBulkOperationId:
      description: Supercase bulk operation ID
      in: path
      name: supercaseBulkOperationId
      required: true
      schema:
        type: string
    noteId:
      description: The ID of the note
      in: path
      name: noteId
      required: true
      schema:
        type: string
    publishReviewTask:
      description: |
        Create case update review task if `true`.
        The task is created only when the user type is `Service`.
      in: query
      name: publishReviewTask
      schema:
        default: true
        type: boolean
    populationId:
      description: The ID of the population
      in: path
      name: populationId
      required: true
      schema:
        type: string
    userId:
      description: Unique user identifier.
      in: path
      name: userId
      required: true
      schema:
        $ref: '#/components/schemas/AnyId'
    roleId:
      description: Unique role identifier.
      in: path
      name: roleId
      required: true
      schema:
        type: string
    includeContextVars:
      description: |
        If `true`, include all the context variables for this template.
      in: query
      name: includeContextVars
      required: false
      schema:
        default: false
        type: boolean
    includeContents:
      description: >-
        If `true`, include the template contents, otherwise only return
        metadata.
      in: query
      name: includeContents
      required: false
      schema:
        default: true
        type: boolean
    subjectFilterQuery:
      description: Only include templates matching these interaction subjects.
      in: query
      name: subject
      required: false
      schema:
        items:
          $ref: '#/components/schemas/InteractionSubject'
        type: array
    parameters-channel:
      description: Only include templates matching this set of interaction channels.
      in: query
      name: channel
      required: false
      schema:
        items:
          $ref: '#/components/schemas/InteractionChannel'
        type: array
    verificationTypeId:
      description: The unique borrower verification type identifier.
      in: path
      name: verificationTypeId
      required: true
      schema:
        type: string
    webhookSubscriptionId:
      description: The ID of the webhook subscription
      in: path
      name: webhookSubscriptionId
      required: true
      schema:
        type: string
  requestBodies:
    Plaid:
      content:
        application/json:
          schema:
            properties:
              clientId:
                description: The Plaid `client_id` from your Plaid dashboard.
                example: 6143abc123def456
                type: string
              secret:
                description: >-
                  The Plaid secret key for your environment (sandbox,
                  development, or production)
                example: abc123def456...
                type: string
            required:
              - clientId
              - secret
            type: object
      required: true
    ExchangeTokenPost:
      content:
        application/json:
          schema:
            properties:
              userId:
                $ref: '#/components/schemas/AnyId'
            required:
              - userId
            type: object
      required: true
    AuthPost:
      content:
        application/json:
          schema:
            anyOf:
              - properties:
                  password:
                    description: The password to authenticate with.
                    format: password
                    type: string
                  username:
                    description: >-
                      The username to authenticated. This can be a username or
                      an email, depending on the configuration.
                    type: string
                type: object
              - properties:
                  exchangeToken:
                    description: >-
                      Temporary exchange token generated by the
                      /auth/exchange-token endpoint.
                    type: string
                type: object
      required: true
    BulkSenderCreate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BulkSenderCreate'
    BulkSenderUpdate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BulkSender'
    ContactExporterCreate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ContactExporter'
    ContactExporterUpdate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ContactExporter'
    BorrowerCampaignCreate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BorrowerCampaign'
    BorrowerCampaignUpdate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BorrowerCampaign'
    BorrowerCampaignRunCreate:
      content:
        application/json:
          schema:
            nullable: true
            properties:
              queryResultsOverride:
                description: >
                  Instead of running the Redash query specified in the Campaign
                  object at `queryRedashUrl`

                  you can overide that query by providing a query results
                  override.


                  Instead of the query being run and its results being used as
                  campaign input, the data provided here

                  is fed into the campaign as input.
                example:
                  - borrowerId: 1
                    loanId: 101
                  - borrowerId: 2
                    loanId: 102
                  - borrowerId: 3
                    loanId: 103
                type: array
            type: object
    BorrowerCampaignRunUpdate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BorrowerCampaignRun'
    CardIssuerPost:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/CardIssuer'
              - required:
                  - status
                  - cardIssuerType
                  - cardType
      required: true
    CardIssuerPut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CardIssuerPut'
      required: true
    CaseTypePost:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CaseTypePostOnly'
      required: true
    CaseTypePut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CaseType'
      required: true
    CommunicatorReceiveOnlyPost:
      content:
        application/json:
          schema:
            allOf:
              - required:
                  - theme
                  - channel
                  - status
              - $ref: '#/components/schemas/Interaction'
      required: true
    CollectionAgencyPost:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/CollectionAgencyPost'
              - required:
                  - legalName
                  - contactPhone
                  - mailingAddress
      required: true
    CollectionAgencyPut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CollectionAgency'
      required: true
    CreditAgencyPost:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/CreditAgency'
              - required:
                  - agencyName
                  - country
                  - dataFormat
              - properties:
                  copyKeysFrom:
                    $ref: '#/components/schemas/AnyId'
                    description: The identifier of the agency to copy keys from.
                  enrollExistingLoans:
                    default: false
                    description: >-
                      Automatically enroll existing active loans for credit
                      reporting with this agency.
                    type: boolean
                type: object
      required: true
    CreditAgencyPut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreditAgency'
      required: true
    LoanLabelPost:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/LoanLabel'
              - required:
                  - name
      required: true
    LoanIdsPut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanIdsRequest'
      required: true
    LoanLabelPut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanLabel'
      required: true
    LoanTapeTypePost:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/TapeType'
              - required:
                  - tapeType
                  - tapeName
                  - fields
      required: true
    LoanTapeTypePut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BaseLoanTapeType'
      required: true
    LoanTapePost:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/LoanTape'
              - required:
                  - loanTapeTypeId
                  - sftpHostname
      required: true
    LoanTapeGeneratePost:
      content:
        application/json:
          schema:
            properties:
              forceReplace:
                default: false
                description: Creates another Loan Tape Record even if one already exists
                type: boolean
              loanTapeIds:
                description: >
                  The loan tape public IDs to generate for. If not provided, we
                  will look up

                  all IDs for the company.
                items:
                  type: string
                nullable: true
                type: array
              reportDates:
                description: |
                  Dates to use for loan tape. Example: `2020-02-01`
                items:
                  format: date
                  type: string
                type: array
              uploadFile:
                default: true
                type: boolean
            type: object
      required: true
    LoanTapePut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanTape'
      required: true
    MerchantPost:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Merchant'
              - required:
                  - businessName
      required: true
    MerchantPut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Merchant'
      required: true
    PromoProgramTypePost:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PromoProgramTypePost'
      required: true
    PromoProgramTypePut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PromoProgramTypePut'
      required: true
    CodeUpdate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Code'
      required: true
    CodeExecution:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CodeExecution'
      required: true
    DoNotInteractType:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DoNotInteractType'
      required: true
    EmployeePost:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Employee'
              - required:
                  - userId
                type: object
      required: true
    EmployeePut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Employee'
      required: true
    EmailSignaturePut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EmailSignatureUpdate'
      required: true
    ConvoJoin:
      content:
        application/json:
          schema:
            properties:
              joinType:
                default: solo
                description: >
                  The method of joining the conversation.


                  - `solo` - only add agent to conversation if there are no
                  other agents in conversations

                  - `add` - simply add agent to conversation

                  - `takeover` - remove all other agents from conversation, the
                  add agent
                enum:
                  - solo
                  - add
                  - takeover
                type: string
            type: object
    Note:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NoteRequest'
      required: true
    IndexRateAdd:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/IndexRate'
      required: true
    IndexRateUpdate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/IndexRateUpdate'
      required: true
    NotificationType:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NotificationType'
      required: true
    PersonRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Borrower'
      required: true
    PersonPutRequest:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/BorrowerNoIdentity'
              - properties:
                  caseId:
                    description: An identifier for an existing case.
                    type: string
                type: object
      required: true
    CanInteract:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CanInteractByContactIdentifier'
      required: true
    CasePost:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Case'
      required: true
    CasePut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CasePut'
      required: true
    AssociationPost:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CaseAssociation'
      required: true
    DoNotInteractCreate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DoNotInteract'
      required: true
    DoNotInteractUpdate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DoNotInteractUpdate'
      required: true
    CaseEscalationPost:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CaseEscalation'
      required: true
    UpdateConsent:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Consents'
      required: true
    ContactBody:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ContactInformation'
      required: true
    IdentityRequest:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Identity'
              - $ref: '#/components/schemas/CaseId'
              - required:
                  - value
                  - identityType
      required: true
    IdentityPutRequest:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/IdentityPut'
              - $ref: '#/components/schemas/CaseId'
      required: true
    InteractionPost:
      content:
        application/json:
          schema:
            allOf:
              - required:
                  - direction
                  - theme
                  - channel
                  - status
              - $ref: '#/components/schemas/Interaction'
      required: true
    InteractionPut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Interaction'
      required: true
    LegalRepresentative:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LegalRepresentative'
      required: true
    LoanPost:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NewLoan'
      required: true
    LoanUpdate:
      content:
        application/json:
          schema:
            properties:
              atOrigination:
                anyOf:
                  - $ref: '#/components/schemas/InstallmentAtOrigination'
                  - $ref: '#/components/schemas/LineOfCreditAtOrigination'
                description: >-
                  This object can only be updated when the loan has
                  `status=pending`.
              chargedOffReason:
                description: >
                  The reason for the loan charge off. You can only update the
                  `chargedOffReason` if the loan status is `chargedOff`.

                  - `term` means the loan was charged off per loan type
                  configuration after X days overdue.

                  - `fraudulent` means the loan was charged off for fraudulent
                  reason. If the loan is reported to one or more credit bureaus,
                  the system will automatically send a special request to each
                  bureau to delete the tradeline due to confirmed fraud. This is
                  the only reason that the system will automatically trigger a
                  request to delete the tradeline. For other reasons, if you
                  need to delete the tradeline please call the `Delete from
                  credit reporting` endpoint or use an agent tool.

                  - `bankruptcy` means the loan was charged off because of
                  bankruptcy.

                  - `legal` means the loan was charged off because of some legal
                  reason.
                enum:
                  - term
                  - fraudulent
                  - bankruptcy
                  - legal
                type: string
              externalId:
                description: >-
                  The lender's identifier for the loan. Requires the
                  `loan:update.force` permission to change.
                nullable: true
                type: string
              metaData:
                $ref: '#/components/schemas/MetaData'
              migration:
                $ref: '#/components/schemas/Migration'
              muteLoanNotices:
                description: >
                  Indicates whether the system should stop/pause sending loan
                  related notices to the borrower. Set to true if you want to
                  mute all loan related notices (e.g. loanDetails.
                  autopayEnabled, paymentFailed, etc.) Keep in mind that it will
                  also stop all notices related to the loan that are sent from
                  Peach Agent Portal by an agent.

                  Note: this is not the only attribute that can stop notices
                  from being sent. Compliance Guard and Cases Do Not Interact
                  can also block communications.
                type: boolean
              nickname:
                description: A nickname the borrower gave the loan.
                type: string
              status:
                $ref: '#/components/schemas/LoanStatus'
            type: object
      required: true
    LoanAccelerate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanAccelerate'
      required: true
    LoanActivate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanActivate'
      required: false
    AutopayPut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AutopayUpdate'
      required: true
    AutopayPost:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AutopayPost'
      required: true
    LoanCancel:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanCancel'
      required: true
    CardPost:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CardWithPanAndCvv'
      required: true
    CardPut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PutCardWithPanAndCvv'
      required: true
    LoanChargeOff:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanChargeOff'
      required: true
    CollectionAgencyLoanDetailsPut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CollectionAgencyLoanDetailsPut'
      required: true
    CreditReportingFieldsPut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanCreditReportingFields'
      required: true
    CreditReportingStatusPost:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/StartCreditReporting'
              - required:
                  - creditAgencyId
                  - reportingStartDate
      required: true
    CreditReportingStatusDelete:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/DeleteCreditReporting'
              - required:
                  - deletedReason
      required: true
    LoanCustomPaymentPlan:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanCustomPaymentPlan'
      required: true
    LoanCustomPaymentPlanCancel:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanCustomPaymentPlanCancel'
      required: true
    LoanDeferDueDate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanDeferDueDate'
      required: true
    LoanDeferSchedule:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanDeferSchedule'
      required: true
    DrawsPost:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Draw'
      required: true
    DrawUpdate:
      content:
        application/json:
          schema:
            properties:
              atOrigination:
                $ref: '#/components/schemas/DrawAtOriginationUpdate'
                description: >-
                  This object can only be updated when the draw has
                  `status=pending`.
              drawType:
                description: >
                  Describes the type of line of credit purchases associated with
                  the draw. Typically used in credit card use cases

                  in which lenders set up draws specifically to be used for cash
                  advances, balance transfers, etc.


                  `cashAdvance` - must be set in order for Peach's system to
                  automatically associate ATM withdrawal and other
                    cash-specific transactions with a specific draw. See Create card issuer endpoint and `drawMapping` attribute for additional configuration details.

                  `balanceTransfer` - enables lenders to create a draw that will
                  house balance transfer transactions.


                  `regularPurchase` - enables lenders to create a draw used for
                  day-to-day purchases. If this attribute is set,
                    Peach's system will automatically associate purchases with this draw based on the card issuer `drawMapping` logic.
                enum:
                  - balanceTransfer
                  - cashAdvance
                  - regularPurchase
                nullable: true
                type: string
              externalId:
                description: >-
                  The lender's identifier for the draw. Requires the
                  `loan:update.force` permission to change.
                nullable: true
                type: string
              nickname:
                description: A nickname the borrower gave the draw.
                type: string
              status:
                $ref: '#/components/schemas/LoanStatus'
            type: object
      required: true
    PromoProgramPost:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PromoProgramPost'
      required: true
    PromoProgramPutDraw:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PromoProgramPutCommon'
      required: true
    PurchaseDisputePost:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PurchaseDispute'
              - properties:
                  createDisputeCase:
                    default: true
                    description: >
                      If `true`, the system will automatically create a
                      `Purchase Dispute` case object and return the case
                      identifier in `caseId` attribute. Alternatively, you can
                      create the case object, pass `createDisputeCase=false` and
                      the case identifier in the `caseId` attribute.
                    type: boolean
                type: object
              - required:
                  - disputedAmount
      required: true
    PurchaseDisputePut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PurchaseDispute'
      required: true
    RateCapAdd:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateCapAdd'
      required: true
    RateCapUpdate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateCapUpdate'
      required: true
    LoanRateAdd:
      content:
        application/json:
          schema:
            allOf:
              - properties:
                  interestRate:
                    allOf:
                      - $ref: '#/components/schemas/InterestRate'
                      - $ref: '#/components/schemas/isEndExistingRatesFlag'
                  promoRate:
                    allOf:
                      - $ref: '#/components/schemas/PromoRate'
                      - $ref: '#/components/schemas/isEndExistingRatesFlag'
                type: object
              - $ref: '#/components/schemas/CaseId'
      required: true
    LoanRateUpdate:
      content:
        application/json:
          schema:
            allOf:
              - properties:
                  interestRate:
                    $ref: '#/components/schemas/InterestRate'
                  promoRate:
                    $ref: '#/components/schemas/PromoRate'
                type: object
              - $ref: '#/components/schemas/CaseId'
      required: true
    DueDatesPost:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DueDatesRequest'
      required: true
    FeesPost:
      content:
        application/json:
          schema:
            properties:
              apiName:
                $ref: '#/components/schemas/FeeApiName'
              caseId:
                description: An identifier for an existing case.
                type: string
              chargeDate:
                $ref: '#/components/schemas/ChargeDate'
              chargeTimeOfDay:
                allOf:
                  - $ref: '#/components/schemas/TimeOfDay'
                  - description: >
                      See description of the `chargeDate`. The value can be
                      provided only if the `chargeDate` attribute is passed. If
                      `chargeTimeOfDay` is not provided,

                      the Peach system will determine and set the time of day.
                    type: object
              customDisplayName:
                description: >
                  A custom description of the fee. If provided, this value will
                  be displayed in Peach UI/App and Statements

                  (or can be used by lender in their App). If the value is not
                  provided, the Peach UI/App and Statements

                  logic will use displayName attribute. To remind, the
                  displayName is populated from the fee type configuration
                  object.
                nullable: true
                type: string
              externalId:
                description: The lender's identifier for the fee.
                type: string
              feeAmount:
                description: >
                  The fee amount, which is required only if the fee type was
                  configured as `chargedLogic=adHoc` and `amountLogic=adHoc`. In
                  all other

                  cases, the system will calculate the fee based on
                  pre-configured logic.
                type: number
              migration:
                $ref: '#/components/schemas/FeesMigrationDetails'
                nullable: true
              previewMode:
                description: In `previewMode=true`, the fee is computed but not charged.
                type: boolean
              triggerPeriodId:
                description: >
                  The ID of the period that "triggered" the fee. For example, if
                  a loan is late by 5 periods, which period is this particular
                  late fee for?
                type: string
            type: object
      required: true
    LocChangeLoanTermsSCRAUpdate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LocChangeLoanTermsSCRAUpdate'
      required: true
    LocChangeLoanTermsSCRA:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LocChangeLoanTermsSCRA'
      required: true
    LoanChangeLoanTerms:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanChangeLoanTerms'
      required: true
    LoanChangeLoanTermsSCRAUpdate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanChangeLoanTermsSCRAUpdate'
      required: true
    LoanChangeLoanTermsSCRA:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanChangeLoanTermsSCRA'
      required: true
    PromiseToPayPlanPost:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PromiseToPayPlanPost'
      description: Promise to pay plan post
    PromiseToPayPlanCancel:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PromiseToPayPlanCancel'
      description: Promise to pay plan cancel
    PromoProgramPut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PromoProgramPut'
      required: true
    LoanRefund:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanRefund'
      required: true
    LoanRefundV2:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanRefundV2'
      required: true
    LoanRefundCancel:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanRefundCancel'
      required: true
    LoanReimburse:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanReimburse'
      required: true
    CaseId:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CaseId'
      required: true
    FailMultipleTransactions:
      content:
        application/json:
          schema:
            items:
              properties:
                achReturnCode:
                  description: >-
                    The ACH return code indicating the reason the transaction
                    failed.
                  example: R01
                  maxLength: 5
                  type: string
                failureReason:
                  $ref: '#/components/schemas/TransactionFailureReason'
                processorFailureDetails:
                  description: >-
                    The error details returned by the payment processor. Can be
                    any valid JSON object.
                  example:
                    code: INSUFFICIENT_FUNDS
                processorFailureReason:
                  description: The raw failure reason returned by the payment processor.
                  example: Insufficient Funds. Retry after 24 hours.
                  type: string
                transactionId:
                  description: ID of the transaction to fail.
                  type: string
              required:
                - transactionId
                - failureReason
              type: object
            type: array
      required: true
    ChargebackPost:
      content:
        application/json:
          schema:
            properties:
              amount:
                description: >
                  The amount of the chargeback. If a value is not provided the
                  system would set the amount to `actualAmount` of the

                  transaction. If partial chargeback(s) were processed in the
                  past, the caller must provide the amount, otherwise

                  the call would fail. Amount provided must be less than or
                  equal to the `effectiveAmount` of the transaction at the

                  time of the call.
                format: float
                type: number
              caseId:
                description: The identifier of an existing case.
                type: string
              category:
                description: >-
                  The chargeback category as received from the payment
                  processor.
                type: string
              externalCaseNumber:
                description: >-
                  The external case number of the chargeback in the payment
                  processor system.
                type: string
              externalId:
                description: The lender's identifer of the chargeback
                type: string
              reasonCode:
                description: The reason code as received from the payment processor.
                type: string
              status:
                $ref: '#/components/schemas/ChargebackStatus'
            type: object
    ChargebackPut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Chargeback'
    ReversalPost:
      content:
        application/json:
          schema:
            properties:
              amount:
                description: >
                  The amount of the reversal. For regular transactions, it may
                  be a partial or full reversal; however, the sum of all
                  successful reversals for the same

                  transaction may not exceed the transaction's
                  `effectiveAmount`. If `amount` is not provided, it will
                  default to the

                  `effectiveAmount` of the original transaction.


                  For past transactions, only full reversals are supported.
                format: float
                type: number
              caseId:
                description: The identifier of an existing case.
                type: string
              externalId:
                description: >
                  The external ID of the reversal transaction. This is separate
                  from the `externalId` of the transaction being reversed in the
                  request parameters.
                maxLength: 200
                minLength: 1
                type: string
              scheduledDate:
                description: >
                  The scheduled date of the reversal transaction. Can only be
                  set for external transactions. If this value is provided, the
                  `status` cannot be set

                  to a status other than `scheduled`, and the system will
                  automatically set `status=scheduled` if the field is not
                  specified.
                format: date
                type: string
              status:
                description: >
                  The status of the reversal transaction, not the original
                  transaction. Status may only be set for external transactions.
                  If a status is not passed,

                  the system will default the status to `scheduled`.

                   - `scheduled` - reversal was scheduled for a future date that has not arrived yet. The reversal has not applied to a loan yet and is not included
                      in the original transaction's `effectiveAmount`.
                   - `initiated` - reversal was initiated and sent to a payment processor. The reversal is applied to a loan and impacts the original transaction's
                      `effectiveAmount`. This status is used normally for ACH.
                   - `pending` - reversal was acknowledged by the payment processor and is being processed.
                   - `succeeded` - reversal was completed successfully. This status is only allowed for past transactions that were created as part of line of credit
                   migration. `status=succeeded` is the only status that can be passed for past transaction reversals. Regular transaction reversals can only be set
                   to `scheduled`, `initiated`, or `pending`.
                enum:
                  - scheduled
                  - initiated
                  - pending
                  - succeeded
                type: string
            type: object
      required: false
    LoanUnfreeze:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanUnfreeze'
      required: true
    VerificationPost:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/VerificationPost'
      required: false
    VerificationAttemptPost:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/VerificationAttemptPost'
      required: true
    SupercasePost:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Supercase'
              - required:
                  - supercaseType
      required: true
    SupercasePut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Supercase'
      required: true
    BulkSendRequestBody:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BulkSendRequestBody'
      required: true
    SupercaseDocumentList:
      content:
        application/json:
          schema:
            description: |
              List of document IDs.
            items:
              description: A document descriptor ID.
              type: string
            type: array
      required: true
    PopulationMemberCollectionPut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PopulationMemberCollection'
      required: true
    PopulationMemberCollectionPost:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PopulationMemberCollection'
      required: true
    PopulationMemberCollectionCSVPut:
      content:
        application/octet-stream:
          schema:
            format: binary
            type: string
      required: true
    PopulationMemberCollectionCSVPost:
      content:
        application/octet-stream:
          schema:
            format: binary
            type: string
      required: true
    PopulationPut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Population'
      required: true
    TeamPost:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Team'
      required: true
    VerificationTypePost:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/VerificationType'
      required: false
    WebhookSubscriptionPost:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/WebhookSubscription'
              - required:
                  - webhookType
      required: true
    WebhookSubscriptionPut:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WebhookSubscriptionPut'
      required: true
  schemas:
    Paging:
      description: |
        Represents a base object for paged results.
      properties:
        count:
          description: Total number of items in this result.
          readOnly: true
          type: integer
        status:
          description: HTTP status code.
          type: integer
      type: object
    CaseEscalation:
      description: >
        Mark a case as needing special attention from a particular team or
        employee.

        Only one of `escalatedTeamId` or `escalatedEmployeeId` may be specified

        at one time.


        If neither `escalatedTeamId` nor `escalatedEmployeeId` are specified
        then the

        latest escalation is canceled.
      properties:
        escalatedEmployeeId:
          description: Escalate the case to the employee specified by this employee ID.
          nullable: true
          type: string
        escalatedTeamId:
          description: Escalate the case to the team specified by this team ID.
          nullable: true
          type: string
        isUrgent:
          default: false
          description: >
            If `true` this escalation is urgent and tasks related to this case
            escalation

            should jump to the front of the agents' queues.
          nullable: true
          type: boolean
        note:
          description: |
            Create a case note with this content explaining why
            the escalation or de-escalation took place
          nullable: true
          type: string
      title: Case Escalation
      type: object
    CaseEscalationDetailed:
      allOf:
        - $ref: '#/components/schemas/CaseEscalation'
        - properties:
            caseId:
              description: The ID of the escalated case.
              type: string
            caseName:
              description: The friendly name given to a case.
              nullable: true
              type: string
            escalationTargetName:
              description: The name of the team or employee the escalation was assigned to.
              type: string
          type: object
      description: |
        A Case Escalation with additional details.
      title: Detailed Case Escalation
    LoanTypeId:
      properties:
        loanTypeId:
          description: >-
            The loan type identifier. This is created specifically for each
            lender's loan product by Peach.
          type: string
      title: Predefined Loan Type
      type: object
    AddressBase:
      additionalProperties: false
      description: |
        The mailing address.
      properties:
        POBox:
          description: Post Office Box
          nullable: true
          type: string
        addressLine1:
          description: >
            Address line 1.


            If `company.allowPartialAddress=false`, then this field is required,
            else it is not required
          maxLength: 100
          type: string
        addressLine2:
          description: Address line 2.
          maxLength: 100
          nullable: true
          type: string
        city:
          description: City.
          type: string
        country:
          description: |
            Country. English short name according to
            [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
          type: string
        countyOrRegion:
          description: County or region.
          nullable: true
          type: string
        object:
          default: address
          enum:
            - address
          readOnly: true
          type: string
        postalCode:
          description: Postal code. Also known as ZIP code.
          type: string
        state:
          description: State/Province. This is a required field if the country is US or CA.
          maxLength: 5
          nullable: true
          type: string
        timezone:
          description: Timezone for the address.
          nullable: true
          readOnly: true
          type: string
      type: object
    Address:
      allOf:
        - $ref: '#/components/schemas/AddressBase'
        - required:
            - country
            - postalCode
          type: object
    AdvanceDetails:
      description: The details of advance.
      nullable: true
      properties:
        categoryId:
          description: The category identifier of the advance.
          nullable: true
          type: string
        description:
          default: Advance
          description: >
            The description of the advance. Normally shown in Borrower Portal
            and on statements. At least one of the attributes, `description`

            or `merchantName` must be passed.
          nullable: true
          type: string
        merchantId:
          description: The merchant identifier that the advance was used for.
          nullable: true
          type: string
        merchantName:
          description: >-
            The merchant name that the advance was used for. At least one of the
            attributes, `description` or `merchantName` must be passed.
          nullable: true
          type: string
        metadata:
          description: Store any type of key/value pairs in the form of a JSON dictionary.
          nullable: true
          type: object
        pointOfSaleType:
          description: >
            - `online` - the advance was made online on a website or in a mobile
            application.

            - `physical` - the advance was made in a store with a physical card
            or instrument.

            - `recurring` - the advance was made as part of a subscription
            service.
          enum:
            - online
            - physical
            - recurring
          type: string
      type: object
    TimeOfDay:
      properties:
        hour:
          description: The hour. Value range is 0-23. 0=Midnight...23=11 PM.
          maximum: 23
          minimum: 0
          type: integer
        minute:
          description: The minute. Value range is 0-59.
          maximum: 59
          minimum: 0
          type: integer
        second:
          default: 0
          description: The second. Value range is 0-59.
          maximum: 59
          minimum: 0
          type: integer
      required:
        - hour
        - minute
      type: object
    externalId:
      description: >
        A lender's identifier for a resource.


        After the resource is successfully created, a lender can use the Peach
        assigned ID OR

        the `externalId` identifiers to fetch the resource.


        ### Fetching with `externalId`:


        To fetch a resource using an `externalId`, you MUST use the prefix
        `ext-` in the URL.


        For example, a loan with an external identifier of `ABCDE` would be
        referenced like `/api/people/BO-FAKE-IDNT/loans/ext-ABCDE`.


        ### Creating with `externalId`:


        To create a resource with an external identifer, you MUST NOT use the
        prefix `ext-`.


        For example, if the external identifier should be `ABCDE`, then pass

        `{ externalId: "ABCDE", ... }` in the request body.
      maxLength: 200
      nullable: true
      type: string
    Advance:
      properties:
        advanceDate:
          description: >
            The date of the advance in the product timezone. The date cannot be
            in the past or greater than the last due date.
             - If the advance is created in `pending` or `settled` status, the advance will be recorded in the ledger with an effective timestamp of
               the Create advance call.
             - If the advance is created in `scheduled` status, the advance will be recorded in the ledger only when the status changes to `pending` or `settled`.
          format: date
          type: string
        advanceDetails:
          $ref: '#/components/schemas/AdvanceDetails'
        advanceTimeOfDay:
          $ref: '#/components/schemas/TimeOfDay'
          description: >-
            The time of day that the advance is entered into the ledger in the
            product timezone.
        amount:
          description: The amount of advance. The amount must be positive.
          format: float
          type: number
        canceledBy:
          description: Identifier of the `User` who canceled the advance.
          readOnly: true
          type: string
        externalId:
          $ref: '#/components/schemas/externalId'
          description: The external unique identifier of the purchase.
        id:
          description: The unique identifier of the purchase.
          readOnly: true
          type: string
        metadata:
          description: Store any type of key/value pairs in the form of a JSON dictionary.
          type: object
        originalAmount:
          description: The original amount of the advance. The amount must be positive.
          format: float
          readOnly: true
          type: number
        status:
          default: settled
          description: >
            - `scheduled` - the advance was scheduled in the future. If the
            advance status doesn't change to `pending`, `settled` or `canceled`
            on the advance due
               date, the system will automatically cancel the advance on the following calendar day (aka change the status to `canceled`).

               For example: An advance was `scheduled` for May 27, 2021. On May 28, 2021, the advance status was still `scheduled`. The system will cancel the advance.

            - `settled` - the advance was settled and/or funded. `settled`
            advances increase the loan balance.


            - `pending` - the advance is pending. `pending` advances increases
            the loan balance similar to `settled`. `pending` status is used
            mainly for visuals
               and normally shown in Borrower Portal.

            - `canceled` - the advance was canceled. `canceled` advances reduce
            the draw balance. A new advance cannot be created in `canceled`
            status.
          enum:
            - scheduled
            - settled
            - pending
            - canceled
          type: string
        timestamps:
          properties:
            canceledAt:
              format: date-time
              readOnly: true
              type: string
            createdAt:
              format: date-time
              readOnly: true
              type: string
            updatedAt:
              format: date-time
              readOnly: true
              type: string
          readOnly: true
          type: object
      title: Advance
      type: object
    AdvanceSchedule:
      description: >
        The advance schedule of the loan. Total amount of the advances must be
        equal to `amountFinanced`. If `advanceSchedule` is passed,

        the system will calculate the APR based on the special formula provided
        in

        [Appendix
        J](https://www.ecfr.gov/cgi-bin/text-idx?SID=747961e095035658cdddba8b09d30a6f&mc=true&node=pt12.9.1026&rgn=div5#ap12.9.1026.0000_0nbspnbspnbsp.j)

        (see examples of loans with multiple advances).
      items:
        allOf:
          - required:
              - status
              - amount
              - advanceDate
            title: Advance
            type: object
          - $ref: '#/components/schemas/Advance'
      nullable: true
      type: array
    AmountFinanced:
      description: The amount of principal on origination or draw.
      format: float
      type: number
    BufferToPushOutSchedule:
      description: >
        The number of calendar days that will be added to the activation date.
        The resulting date will be used to push out

        due dates as if the loan was activated on that date (activation date +
        buffer). Interest will still be accrued

        normally from the activation date. Not valid for the singleTerm
        frequency.
      format: float
      nullable: true
      type: number
    OriginationFeeAmount:
      default: 0
      description: The origination fee amount.
      format: float
      nullable: true
      type: number
    InstallmentPaymentFrequency:
      description: >
        The payment frequency of the loan.


        `weekly`, `everyTwoWeeks`, `twiceMonthly`, `monthly` - are recurring.


        `singleTerm` - a single term loan (aka non-recurring). It will create
        one period only with a desired "duration" of 30, 60, 90, 120, X calendar
        days or a specific date that should be passed in specificDays. For
        example [90].
      enum:
        - weekly
        - everyTwoWeeks
        - twiceMonthly
        - monthly
        - singleTerm
      type: string
    PeriodicPaymentAmount:
      description: >
        The amortized periodic payment amount excluding fees. Keep in mind that
        the last payment

        can be different from the `periodicPaymentAmount`.
      format: float
      nullable: true
      title: Periodic Payment Amount
      type: number
    PrincipalAmount:
      description: >
        The amount of principal at origination. Lenders should only pass this
        value if `principalAmount` is different from `amountFinanced`.

        If a value is provided, the system will use `principalAmount` as the
        loan principal for interest calculations and amortization. The value
        should be greater than `amountFinanced`.

        If a value is not provided, the system will:

        - Set `principalAmount = amountFinanced`.

        - Use `amountFinanced` as the loan principal for interest calculations
        and amortization.
      format: float
      nullable: true
      type: number
    SpecificDays:
      description: >
        Specific days designate the day(s) that due dates will fall on. The
        allowed values for specific

        day(s) depends on the `paymentFrequency`.


        `weekly` - provide one number in the valid range 1-7.
        1=Monday...7=Sunday.


        For example: [1].


        `everyTwoWeeks` - provide two inputs. The first input (required) is an
        integer in the valid range 1-7. 1=Monday...7=Sunday.


        The second input is a date that indicates when to start the cycle. If
        the second input is not passed, the system will default

        to the first valid start date based on the first input (the day of week
        passed in). If this date is provided then it can override

        the minimum due date gap specified on the loan type.


        For example: [1, "2020-09-16"].


        `twiceMonthly` - provide two numbers in the valid range 1-31. 1=first
        day of a month. Use 31 to

        indicate the last day of a month.


        For example: [1, 15] or [15, 31].


        `monthly` - provide one or two numbers, depending on the loan type
        `periodCalculationType` configuration:
          - If `periodCalculationType=dueDate`, then provide one number in the valid range 1-31. This is the recurring due date. 1=first
          day of a month. Use 31 to indicate the last day of a month. For example: [1].
          - If `periodCalculationType=statementDate`, then provide one number in the valid range 1-31. This is the recurring statement date.
          1=first day of a month. Use 31 to indicate the last day of a month. For example: [1].
          - If `periodCalculationType=fixedStatementAndDueDates`, then provide two numbers. First number represents a recurring statement
          date and the valid range is 1-31. Use 31 to indicate the last day of a month. Second number represents a recurring due date and
          the valid range is 1-28. Two numbers must be different. For example: [1, 15] - statements are on 1st and due dates are on 15th.
          Notes:
            - If the due date precedes the statement day, it's pushed to the next month. For example: [20, 10] and today is Oct 1, 2024. The
            first statement date is Oct 20, 2024 and the first due date is Nov 10th.
            - For February in non-leap years, if the statement date is ≥ 29 and the due date is 28, the statement date becomes March 1st.

        `singleTerm` - provide one number to indicate duration as a number of
        calendar days or provide a valid calendar date in the

        future. This option is only valid for use on the installment type and at
        loan origination.

        For example: [90] or ["2020-09-16"].


        For `weekly`, `everyTwoWeeks`, `twiceMonthly`, `monthly`:

        If specificDays is left null, then the system will calculate due dates
        according to the paymentFrequency relative

        to the origination or activation date (or use existing specific days in
        the case of change due date).


        For `singleTerm`:

        The specificDays is mandatory.
      items:
        anyOf:
          - nullable: true
            type: string
          - type: integer
      nullable: true
      type: array
    GenericInstallmentOriginationPropertiesBase:
      properties:
        advanceSchedule:
          $ref: '#/components/schemas/AdvanceSchedule'
        amountFinanced:
          $ref: '#/components/schemas/AmountFinanced'
        bufferToPushOutSchedule:
          $ref: '#/components/schemas/BufferToPushOutSchedule'
        fees:
          properties:
            originationFeeAmount:
              $ref: '#/components/schemas/OriginationFeeAmount'
          type: object
        paymentFrequency:
          $ref: '#/components/schemas/InstallmentPaymentFrequency'
        periodicPaymentAmount:
          $ref: '#/components/schemas/PeriodicPaymentAmount'
        principalAmount:
          $ref: '#/components/schemas/PrincipalAmount'
        specificDays:
          $ref: '#/components/schemas/SpecificDays'
        startDate:
          description: >-
            The start date of the loan or line of credit. Passing in `"today"`
            will set the field to today's date. In the case of the predefined
            loan type configuration, `"today"` will be converted to the date in
            the product timezone.
          format: date
          type: string
      required:
        - startDate
        - amountFinanced
        - paymentFrequency
      type: object
    DiscountProgramIds:
      properties:
        discountProgramIds:
          description: >
            The identifiers of the discount programs provided at origination. A
            discount program

            has to be created before it can be applied to loans.
          items:
            type: integer
          nullable: true
          type: array
      title: Discount Program Ids
      type: object
    AtOriginationDynamicFees:
      description: >
        Dynamic fees details.


        Applicable if your loan type has dynamic fee(s) pre-defined and fee(s)
        amount are different among loans.


        Also, for a Line of Credit, this configuration is used to set a dynamic
        fee type on a selected draw when a dynamic fee type is

        configured with `appliedToDraws` is `True` and `drawApplicationLogic` is
        `selectedDraws`.


        Currently, the following dynamic fee types are supported: `purchaseFee`,
        `foreignTransactionFee`, `lateFee`, `serviceFee`, `nsfFee`.

        Please note `lateFee` and `nsfFee` can only be configured on a single
        draw.
      items:
        properties:
          apiName:
            description: >
              The API name of the dynamic fee. For example: `lateFee` or
              `breatherFee`.

              If applicable, `purchaseFee` or `foreignTransactionFee` `apiName`
              must be included, so it is applied to a specific draw.

              Please confirm configs with the Peach team to ensure purchase fees
              are correctly configured.

              When both `apiName` and `dynamicFeeTypeId` are provided, `apiName`
              is preferred.
            type: string
          dynamicFeeTypeId:
            description: >
              Public ID of the dynamic fee type (for example, `FT-XXXX-XXXX`).
              Alternative to `apiName`.

              When both `apiName` and `dynamicFeeTypeId` are provided, `apiName`
              is preferred.
            type: string
          feeAmount:
            description: >
              The fee amount that will be charged recurrently. Only required if
              the dynamic fee `amountLogic` is configured as

              `type=passedAtOrigination`. In all other cases, the system will
              calculate the fee based on pre-configured logic.
            format: float
            nullable: true
            type: number
          feeCapAmount:
            description: >
              The maximum amount of the dynamic fee that can be charged over the
              life of the loan or draw. Only required if the dynamic fee

              `capLogic` is configured as `type=capPassedAtOrigination`. In all
              other cases, the system will calculate the fee based on
              pre-configured

              logic.
            format: float
            nullable: true
            type: number
        type: object
      nullable: true
      type: array
    ServiceFee:
      properties:
        fees:
          properties:
            dynamicFees:
              $ref: '#/components/schemas/AtOriginationDynamicFees'
            serviceFeeAmount:
              description: >
                **DEPRECATED ATTRIBUTE** Use `dynamicFees.feeAmount`.**


                The service fee amount that will be charged recurrently. Only
                required if the service fee `amountLogic` is configured as

                `type=passedAtOrigination`. In all other cases, the system will
                calculate the fee based on pre-configured logic.
              format: float
              type: number
            serviceFeeCapAmount:
              description: >
                **DEPRECATED ATTRIBUTE** Use `dynamicFees.feeCapAmount`.**


                The maximum amount of the service fee that can be charged over
                the life of the loan or draw. Only required if the service fee

                `capLogic` is configured as `type=capPassedAtOrigination`. In
                all other cases, the system will calculate the fee based on
                pre-configured

                logic.
              format: float
              type: number
          type: object
      title: Service Fee Origination Terms
      type: object
    PredefinedInstallmentLoanAtOriginationBase:
      allOf:
        - properties:
            address:
              $ref: '#/components/schemas/Address'
            personAddressId:
              description: >
                This is the existing identifier of a borrower's address contact
                information

                (Peach's unique or lender's external identifier). If passed
                during origination,

                the address will be stored on the loan object as a reference.
                This field, or the

                mutually exclusive `personAddress` field containing an address
                directly, is

                required.
              pattern: ^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$
              type: string
              writeOnly: true
          type: object
        - $ref: '#/components/schemas/GenericInstallmentOriginationPropertiesBase'
        - $ref: '#/components/schemas/DiscountProgramIds'
        - $ref: '#/components/schemas/ServiceFee'
    LoanDuration:
      description: >
        The duration of the loan as a number of `paymentFrequency` periods.

        For example:

        - if `paymentFrequency=monthly` and `duration=6`, it's a loan with 6
        months duration and will have 6 due dates.

        - if `paymentFrequency=weekly` and `duration=24`, it's a loan with 24
        weeks duration and will have 24 due dates.
      title: Duration of a Loan
      type: integer
    LoanInterestRatesAtOrigination:
      description: >
        Interest rates for the loan or the draw. Can be a single interest rate
        for the entire duration of the loan/draw.

        Or, it can be multiple interest rates for partial periods of the
        loan/draw. If draw-specific rates are not passed,

        the draw will use the LOC rates.
      items:
        properties:
          days:
            description: >
              Number of calendar days the interest rate applies to. An entry
              with `days: null` is required

              at the end of the list to indicate that the interest rate applies
              to the end of the loan duration.

              For example:


              `{"days": 30, "rate": 0.1},`


              `{"days": 60, "rate": 0.2},`


              `{"days": null, "rate": 0.25}`


              The loan will accrue interest of 10% for the first 30 days.
              Between days 31-90

              the loan will accrue interest of 20%. From day 91 until the end,
              the loan will accrue

              interest of 25%.
            nullable: true
            type: integer
          interestType:
            default: absolute
            description: >
              The interest type. The interest type cannot be changed after the
              loan or draw status changes to `originated` and onward.


              `absolute` - interest rates defined as `absolute` will use the
              value as provided here without adding the Index Interest Rate.
                - Negative interest `rate` value is not allowed.
                - If the provided `rate` is outside of the range defined on the loan type, the system will accept the `rate` but will return a warning in the response's object `ratesValidation`.

              `spread` - interest rates defined as `spread` will calculate an
              absolute rate by adding the relative loan rate (aka spread)

              provided in the `rate` attribute to the Index Interest Rate
              effective on the date the interest is accrued.

              In case the Index Interest Rate is not set, the system will assume
              that the Index Interest Rate value is zero on the date the
              interest is accrued.
                - Negative interest spread `rate` value is allowed, but the system will default to zero if the addition of the Index Interest Rate still results in a negative rate.
                - If the calculated absolute rate, `rate` (aka spread) plus Index Interest Rate, is outside of the range defined on the loan type, the system will accept the `rate` but will return a warning in the response's object `ratesValidation`.
            enum:
              - absolute
              - spread
            type: string
          rate:
            description: >
              The annual interest rate for the period defined. The format is
              decimal.

              For example, 0.01 is a 1% annual rate, 0.2 is a 20% annual rate.
            format: float
            type: number
        required:
          - days
          - rate
        type: object
      type: array
    LoanPromoRatesAtOrigination:
      description: >
        The promotional interest rates (aka rate discounts) for the loan or the
        draw.

        Can be a single promo rate for the entire duration of the loan/draw.

        Or, it can be multiple promo rates for partial periods of the loan/draw.


        For example, if the `interestRate` is 20% for the first 90 days and the
        `promoRate` has value

        5% for 30 days, then the effective rate for the first 30 days is 15%.


        The promo rates are unconditional and will be applied regardless of the
        loan status.
      items:
        properties:
          days:
            description: >
              Number of calendar days the promo rate applies to. Use `null` to
              indicate that

              the promo rate applies to the end of the loan duration.

              For example:


              `{"days": 30 ,"rate": 0.1},`


              `{"days": null, "rate": 0.01}`


              The loan will receive interest discount of 10% for the first 30
              days.

              From day 31 until the end, the loan will receive interest discount
              of 1%.
            nullable: true
            type: integer
          rate:
            description: >
              The annual promo rate for the period defined. Loans cannot accrue
              negative interest rate.

              If the promo rate is greater than the interest rate, a loan will
              accrue 0% interest rate.

              The format is decimal. For example, 0.01 is a 1% annual rate, 0.15
              is a 15% annual rate.
            format: float
            type: number
        type: object
      nullable: true
      type: array
    TotalInterestCapAmount:
      description: >-
        The maximum amount of interest the borrower will ever pay. If not
        applicable, set to `null`.
      format: float
      nullable: true
      title: Total Interest Cap Amount
      type: number
    GenericInstallmentOriginationPropertiesRates:
      properties:
        duration:
          $ref: '#/components/schemas/LoanDuration'
        interestRates:
          $ref: '#/components/schemas/LoanInterestRatesAtOrigination'
        promoRates:
          $ref: '#/components/schemas/LoanPromoRatesAtOrigination'
        totalInterestCapAmount:
          $ref: '#/components/schemas/TotalInterestCapAmount'
      required:
        - duration
        - interestRates
      type: object
    PredefinedInstallmentLoanAtOrigination:
      allOf:
        - $ref: '#/components/schemas/PredefinedInstallmentLoanAtOriginationBase'
        - $ref: '#/components/schemas/GenericInstallmentOriginationPropertiesRates'
    predefinedInstallmentLoanProperties:
      allOf:
        - $ref: '#/components/schemas/LoanTypeId'
        - properties:
            atOrigination:
              $ref: '#/components/schemas/PredefinedInstallmentLoanAtOrigination'
          required:
            - atOrigination
            - loanTypeId
          type: object
      title: Predefined Installment Loan
    LoanId:
      properties:
        loanId:
          description: |
            An identifier of a loan for which to track interactions
          type: string
      title: Loan ID
      type: object
    LOCPaymentFrequency:
      description: >-
        The frequency of the due dates schedule. For line of credit, 'weekly' is
        not allowed.
      enum:
        - everyTwoWeeks
        - twiceMonthly
        - monthly
      type: string
    GenericLOCOriginationProperties:
      properties:
        amountFinanced:
          $ref: '#/components/schemas/AmountFinanced'
        bufferToPushOutSchedule:
          $ref: '#/components/schemas/BufferToPushOutSchedule'
        fees:
          properties:
            originationFeeAmount:
              $ref: '#/components/schemas/OriginationFeeAmount'
          type: object
        interestRates:
          $ref: '#/components/schemas/LoanInterestRatesAtOrigination'
        paymentFrequency:
          $ref: '#/components/schemas/LOCPaymentFrequency'
        promoRates:
          $ref: '#/components/schemas/LoanPromoRatesAtOrigination'
        specificDays:
          $ref: '#/components/schemas/SpecificDays'
        startDate:
          description: >-
            The start date of the loan or line of credit. Passing in `"today"`
            will set the field to today's date. In the case of the predefined
            loan type configuration, `"today"` will be converted to the date in
            the product timezone.
          format: date
          type: string
      type: object
    PersonAddressId:
      properties:
        personAddressId:
          description: >
            The address where a loan was originated. If an address was already
            created in Peach's system,

            a lender can pass the borrower's contact information identifier.
            (Peach's unique or lender's

            external identifier). Alternatively, the lender can provide address
            details in the

            `personAddressAtOrigination` attribute.
          nullable: true
          pattern: ^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$
          type: string
          writeOnly: true
      title: Address where a loan was originated.
      type: object
      writeOnly: true
    DrawProperties:
      properties:
        drawDuration:
          description: >
            The duration of the draw as a number of `dueDatesFrequency` periods.

            For example:

            - if `dueDatesFrequency=monthly` and `duration=6`, it's a draw with
            6 months duration and will have 6 due dates.
          type: integer
        drawStartDate:
          description: >-
            The draw start date. Passing in `"today"` will set the field to
            today's date. In the case of the predefined loan type configuration,
            `"today"` will be converted to the date in the product timezone.
          format: date
          type: string
        fees:
          properties:
            drawFeeAmount:
              default: 0
              description: The draw fee amount.
              format: float
              type: number
          type: object
        paymentFrequency:
          $ref: '#/components/schemas/LOCPaymentFrequency'
      type: object
    predefinedLineOfCreditLoanProperties:
      allOf:
        - $ref: '#/components/schemas/LoanTypeId'
        - $ref: '#/components/schemas/LoanId'
        - properties:
            atOrigination:
              allOf:
                - $ref: '#/components/schemas/GenericLOCOriginationProperties'
                - $ref: '#/components/schemas/PersonAddressId'
                - properties:
                    address:
                      $ref: '#/components/schemas/Address'
                  type: object
                - $ref: '#/components/schemas/DiscountProgramIds'
                - $ref: '#/components/schemas/DrawProperties'
                - $ref: '#/components/schemas/ServiceFee'
              required:
                - amountFinanced
                - drawDuration
                - drawStartDate
          required:
            - atOrigination
          type: object
      title: Predefined Line Of Credit
    AmortUtilPeriodCalculationType:
      properties:
        periodCalculationType:
          default: dueDate
          description: >
            `dueDate` - this configuration allows borrowers to have the same due
            date every month

            (for example, the 15th, 28th, or the last day of every month). In
            this configuration,

            the statement date is calculated as an offset from the dueDate and
            might be a different day of the month every period.

            The system will calculate the first period using the dueDate in
            reference to the following

            attributes: `dueDateType`, `dueDateAdjustment`,
            `atOrigination.paymentFrequency`, `atOrigination.specificDays` and

            `atOrigination.bufferToPushOutSchedule`. The subsequent periods are
            calculated as recurring due dates.

            Using the calculated `dueDate` as an "anchor", the first
            `statementDate` will then be calculated as a

            negative "offset" from the first due date. The "offset" is
            represented as a number of calendar days based on

            loan type `locStatementCreationDaysOffset` configuration.


            `statementDate` - this configuration allows borrowers to have the
            same statement date every month

            (for example, the 15th, 28th, or the last day of every month). In
            this configuration,

            the due date might be a different day of the month every period.

            The system will calculate the first period using the `statementDate`
            as an "anchor" and take the following attributes

            into account: `atOrigination.paymentFrequency`,
            `atOrigination.specificDays` and
            `atOrigination.bufferToPushOutSchedule`.

            The statement date can only be a calendar day, and it cannot be
            forced as a business day. Once the statement date is set,

            the system will calculate the first due date based on the
            `dueDateType` and `dueDateAdjustment` attributes.

            The first due date will be calculated as a positive "offset" from
            the first statement date.

            If the `dueDateType=business`, then we might need to adjust the due
            date. The "offset" is represented as

            number of calendar days based on the loan type's
            `locStatementCreationDaysOffset` configuration.

            The following periods are calculated as recurring statement dates
            (similar to the first period).

            Only applies to line of credit, not installment loans.
          enum:
            - dueDate
            - statementDate
          type: string
      type: object
    AccrualMethodWithoutCompoundWithFees:
      default: simple
      description: >
        `simple` - the system will accrue interest on outstanding principal
        buckets/balances only.


        `compound` - the system will accrue interest on outstanding principal
        and interest buckets/balances.
      enum:
        - simple
        - compound
      type: string
    DueDatesGap:
      nullable: true
      properties:
        everyTwoWeeks:
          properties:
            max:
              default: 21
              type: integer
            min:
              default: 7
              type: integer
          type: object
        monthly:
          properties:
            max:
              default: 46
              type: integer
            min:
              default: 10
              type: integer
          type: object
        singleTerm:
          description: Valid onlyfor installment loans.
          properties:
            max:
              default: 365
              type: integer
            min:
              default: 10
              type: integer
          type: object
        twiceMonthly:
          properties:
            max:
              default: 23
              type: integer
            min:
              default: 7
              type: integer
          type: object
        weekly:
          properties:
            max:
              default: 10
              type: integer
            min:
              default: 4
              type: integer
          type: object
      type: object
    FeeChargeLogic:
      default: onTopPeriodicPayment
      description: >
        Indicates how to allow the fee.


        `onTopPeriodicPayment` - the fee will be added on top of the upcoming
        amortized payment. It means that the upcoming

        payment will be higher than others.

        For example: first payment amount is $50 periodic payment plus $10
        origination fee, total of $60. Second and onward payments' amount is
        $50.


        `blendWithPeriodicPayment` - the fee will part of the upcoming periodic
        payment. It means that all expected payments

        will be equal (except for the last one.)

        For example: first payment amount is $50, $10 of which is the
        origination fee and $40 is amortized payment. Second and onward
        payments' amount is $50.


        `chargedAtOrigination` - the fee was charged at time of the origination.
        The fee will not be allocated to future amortized payments.
      enum:
        - onTopPeriodicPayment
        - blendWithPeriodicPayment
        - chargedAtOrigination
      nullable: true
      type: string
    GenericLoanConfigProperties:
      allOf:
        - $ref: '#/components/schemas/AmortUtilPeriodCalculationType'
        - properties:
            accrualMethod:
              $ref: '#/components/schemas/AccrualMethodWithoutCompoundWithFees'
            dailyInterestCalculationMethod:
              default: 365
              description: >
                `360` - this loan amortization method assumes that there are 360
                days a year and 30 days in each month.

                The daily interest rates are calculated by taking the annual
                interest rate and dividing it by 360. This value

                must be used if `periodType=fixed.`


                `365` - this loan amortization method assumes that there are 365
                days a year and actual number of days between periods.

                The daily interest rates are calculated by taking the annual
                interest rate and dividing it by 365.
              enum:
                - 360
                - 365
              nullable: true
              type: integer
            dueDateAdjustment:
              default: backward
              description: >
                When a due date falls on non-business date, the due date is
                moved `backward` or `forward` until it falls on

                the closest business date. For example, a due date falls on
                Sunday the 06/16/2019. If `dueDateAdjustment=backward`,

                the due date will be adjusted to 06/14/2019. If
                `dueDateAdjustment=forward`, the due date will be adjusted to
                06/17/2019.
              enum:
                - backward
                - forward
              nullable: true
              type: string
            dueDateType:
              default: business
              description: >
                `business` - means that due dates must fall on business date
                only. If a due date falls on non-business date,

                the due dates will be adjusted in `dueDateAdjustment` direction.


                `calendar` - means that due dates can fall on any dates.
              enum:
                - business
                - calendar
              nullable: true
              type: string
            gapBetweenDueDates:
              $ref: '#/components/schemas/DueDatesGap'
            originationFeeAPRCalcOverride:
              default: noOverride
              description: >
                If `noOverride` the APR will be calculated as if the origination
                fee will be calculated per the

                `originationFeeChargeLogic`. If `atOrigination` the APR will be
                calculated as if origination fee

                was collected at origination regardless of the
                `originationFeeChargeLogic`.
              enum:
                - noOverride
                - atOrigination
              type: string
            originationFeeChargeLogic:
              $ref: '#/components/schemas/FeeChargeLogic'
          type: object
    AmortizationMethod:
      default: equalPayments
      description: >
        Loan amortization method.


        `equalPayments` - the system will amortize the loan or draw making
        recurring payments equal (except maybe for the last payment).

        Most installment loans are expected to use this method.


        `interestPaymentsBalloonPrincipal` - the system will amortize the loan
        or draw making recurring payments equal to interest only

        and the last payment will include the entire principal. Keep in mind
        that if you set `interest.periodAccrualDurationType=actual`,

        the recurring payment amounts will be different every period for monthly
        and twice monthly frequencies. This is because a month

        can have 28, 29, 30 or 31 days and interest accrued will vary based on
        the number of days in the month.


        There are additional limitations to be aware for
        `interestPaymentsBalloonPrincipal`. For installment loans, Autopay can
        only be

        aligned to due dates. It means that
        `autoPay.allowedFrequency.isDueDatesAvailable` must be set to `false`.
        This way the system

        will only allow Autopay to be aligned to the loan frequency and due
        dates.
      enum:
        - equalPayments
        - interestPaymentsBalloonPrincipal
        - custom
      type: string
    LoanAssetType:
      description: The generic asset types that are supported.
      enum:
        - personalClosedEndUnsecured
        - personalOpenEndUnsecured
        - personalClosedEndSecured
        - personalOpenEndSecured
        - motorMVRISC
        - motorDirect
        - motorLease
        - businessClosedEndUnsecured
        - businessOpenEndUnsecured
        - businessClosedEndSecured
        - businessOpenEndSecured
      type: string
    GenericInstallmentOriginationProperties:
      allOf:
        - $ref: '#/components/schemas/GenericInstallmentOriginationPropertiesBase'
        - $ref: '#/components/schemas/GenericInstallmentOriginationPropertiesRates'
    installmentLoanProperties:
      allOf:
        - $ref: '#/components/schemas/GenericLoanConfigProperties'
        - properties:
            amortizationMethod:
              $ref: '#/components/schemas/AmortizationMethod'
            assetType:
              $ref: '#/components/schemas/LoanAssetType'
              readOnly: true
            atOrigination:
              $ref: '#/components/schemas/GenericInstallmentOriginationProperties'
            maxAPR:
              description: |
                Indicates whether the loan has a maximum APR
              format: float
              nullable: true
              type: number
            periodAccrualDurationType:
              default: actual
              description: >
                `fixed` - each period is assumed to be fixed number of calendar
                days.

                For `monthly` frequency we assume 30 days between any two
                consecutive due dates.

                For `twiceMonthly` frequency we assume 15 days between any two
                consecutive due dates.

                For `overyTwoWeeks` frequency we assume 14 days between any two
                consecutive due dates.

                For `weekly` frequency we assume 7 days between any two
                consecutive due dates.


                `actual` - we calculate actual number of days in a period. For
                example, for `monthly` frequency

                number days in a period can be 28, 29, 30 or 31.


                For line of credit we only support `actual`.
              enum:
                - fixed
                - actual
              nullable: true
              type: string
            periodType:
              default: periodEnd
              enum:
                - periodBegin
                - periodEnd
              type: string
            singleTermUnitPeriod:
              default: days
              enum:
                - days
                - months
                - sixMonths
                - years
              type: string
          required:
            - atOrigination
          type: object
      title: Generic Installment Loan
    lineOfCreditLoanProperties:
      allOf:
        - $ref: '#/components/schemas/GenericLoanConfigProperties'
        - properties:
            amortizationMethod:
              $ref: '#/components/schemas/AmortizationMethod'
            assetType:
              $ref: '#/components/schemas/LoanAssetType'
              readOnly: true
            atOrigination:
              allOf:
                - $ref: '#/components/schemas/GenericLOCOriginationProperties'
                - $ref: '#/components/schemas/DrawProperties'
              required:
                - startDate
                - amountFinanced
                - interestRates
                - paymentFrequency
                - drawDuration
                - drawStartDate
            drawFeeChargeLogic:
              $ref: '#/components/schemas/FeeChargeLogic'
            statementCloseToDueDatePeriod:
              default: 14
              description: >
                Number of calendar days between statement close date and a due
                date.

                Typically, 14 or 21 days. Applicable for line of credit only.
              nullable: true
              type: integer
          required:
            - atOrigination
          type: object
      title: Generic Line of Credit
    AmortizableLoan:
      anyOf:
        - $ref: '#/components/schemas/predefinedInstallmentLoanProperties'
        - $ref: '#/components/schemas/predefinedLineOfCreditLoanProperties'
        - $ref: '#/components/schemas/installmentLoanProperties'
        - $ref: '#/components/schemas/lineOfCreditLoanProperties'
    SingletonResponse:
      properties:
        message:
          description: Description of the server action or error.
          type: string
        status:
          description: HTTP status code.
          type: integer
      type: object
    AmortizationLite:
      description: Amortization details
      properties:
        fees:
          properties:
            originationFeeAmount:
              description: |
                The amount of the origination fee.
              format: float
              nullable: true
              type: number
            totalOtherFeesAmount:
              description: >
                The total amount of non-origination fees that are expected to be
                charged on the loan.
              format: float
              readOnly: true
              type: number
          type: object
        interestRateBelowMinOrZero:
          description: The interest rate is below the minimum annual interest rate.
          type: boolean
        interestRateExceedsMax:
          description: The interest rate exceeds the maximum annual interest rate.
          type: boolean
        numberPayments:
          description: The number of expected payment due dates.
          type: integer
        periodicPaymentAmount:
          description: >-
            The amortized periodic payment amount expected to be paid by the
            borrower on due dates.
          format: float
          type: number
        totalDiscountAmount:
          description: >
            The total amount of discount at origination as a result of promo
            rates.
          format: float
          type: number
        totalInterestAmount:
          description: >
            The total amount of interest the loan should accrue. Because of
            rounding issues, the total of expected

            payments `interestAmount` might be different from
            `totalInterestAmount`.
          format: float
          type: number
        totalPaymentsAmount:
          description: The total amount of expected payments.
          format: float
          type: number
      type: object
    Amortization:
      allOf:
        - $ref: '#/components/schemas/AmortizationLite'
        - properties:
            amountFinanced:
              $ref: '#/components/schemas/AmountFinanced'
            schedule:
              items:
                properties:
                  amount:
                    description: The amount of the expected payment.
                    format: float
                    type: number
                  date:
                    description: The due date of the expected payment.
                    format: date
                    type: string
                  dynamicFeeDetails:
                    description: >
                      When `paymentType`=`dynamicFee` this will contain details
                      of the dynamic fee.
                    properties:
                      apiName:
                        description: >
                          The API name of the dynamic fee. For example:
                          'lateFee' or 'breatherFee'.
                        type: string
                      displayName:
                        description: >
                          The display name of the dynamic fee as shown to the
                          borrower in the UI. For example: `Late Fee` or
                          `Breather Fee`.
                        type: string
                      dynamicFeeTypeId:
                        description: The dynamic fee type identifier in the system.
                        type: string
                    type: object
                  interestAmount:
                    description: |
                      The portion of the `amount` allocated to net interest.
                      Available only for `paymentType=periodicPayment`.
                    format: float
                    type: number
                  interestBeforeDiscountAmount:
                    description: >
                      The interest amount that was accrued before promo rate(s)
                      or any discount.

                      Available only for `paymentType=periodicPayment`.
                    format: float
                    type: number
                  paymentType:
                    description: The payment type.
                    enum:
                      - periodicPayment
                      - originationFee
                      - drawFee
                      - dynamicFee
                      - downPayment
                      - discountCredit
                    type: string
                  principalAmount:
                    description: |
                      The portion of the `amount` allocated to principal.
                      Available only for `paymentType=periodicPayment`.
                    format: float
                    type: number
                  unroundedInterestAmount:
                    description: >
                      The portion of the `amount` allocated to net interest.
                      Available only for `paymentType=periodicPayment`.

                      This value is unrounded.
                    nullable: true
                    type: string
                  unroundedInterestBeforeDiscountAmount:
                    description: >
                      The interest amount that was accrued before promo rate(s)
                      or any discount. Available only for

                      `paymentType=periodicPayment`. This value is unrounded.
                    nullable: true
                    type: string
                  unroundedPrincipalAmount:
                    description: >
                      The portion of the `amount` allocated to principal.
                      Available only for `paymentType=periodicPayment`.

                      This value is unrounded.
                    nullable: true
                    type: string
                type: object
              type: array
          type: object
    InstallmentAmortization:
      allOf:
        - properties:
            aprEffective:
              description: The calculated effective APR for the loan.
              format: float
              type: number
            aprEffectiveExceedsMax:
              description: The effective APR exceeds the maximum APR.
              type: boolean
            aprNominal:
              description: The calculated nominal APR for the loan.
              format: float
              type: number
            aprNominalExceedsMax:
              description: The nominal APR exceeds the maximum APR.
              type: boolean
            forgoneInterestAmount:
              description: >-
                Forgone interest amount due to the specified
                `interestCapAmount`.
              format: float
              type: number
          type: object
        - $ref: '#/components/schemas/Amortization'
      description: Installment amortization details
      title: Installment amortization details
    LineOfCreditAmortization:
      allOf:
        - $ref: '#/components/schemas/Amortization'
      description: Line of Credit loan amortization details
      title: Line of Credit amortization details
    AmortizationResult:
      anyOf:
        - $ref: '#/components/schemas/InstallmentAmortization'
        - $ref: '#/components/schemas/LineOfCreditAmortization'
      type: object
    Combinations:
      description: |
        The combinations of duration, interest rates, promo rates, and
        maximum interest cap for the requested amount financed
      items:
        allOf:
          - properties:
              combinationId:
                description: |
                  The identifier of this specific amortization combination
                  of duration, interest rates, promo rates and total
                  interest cap amount.
                nullable: false
                type: string
            required:
              - combinationId
            type: object
          - $ref: '#/components/schemas/GenericInstallmentOriginationPropertiesRates'
      nullable: false
      type: array
    AmortizeCombinationsBody:
      allOf:
        - $ref: '#/components/schemas/LoanTypeId'
        - properties:
            atOrigination:
              allOf:
                - $ref: >-
                    #/components/schemas/PredefinedInstallmentLoanAtOriginationBase
                - properties:
                    combinations:
                      $ref: '#/components/schemas/Combinations'
                  required:
                    - combinations
                  type: object
          required:
            - loanTypeId
            - atOrigination
          type: object
    AmortizationCombinationsResult:
      items:
        allOf:
          - properties:
              combinationId:
                nullable: false
                type: string
            type: object
          - $ref: '#/components/schemas/AmortizationLite'
          - properties:
              forgoneInterestAmount:
                description: |
                  Forgone interest amount due to the specified
                  `interestCapAmount`.
                format: float
                type: number
            type: object
      nullable: false
      type: array
    AnyId:
      description: Peach's unique or lender's external identifier.
      pattern: ^ext-|^[A-Z][A-Z0-9]-[A-Z0-9]+-[A-Z0-9]+|^\d+$
      type: string
      writeOnly: true
    UserPermissions:
      additionalProperties:
        description: >
          User permissions per company. An object keyed by `companyId`'s as
          strings.

          The value for a given `companyId` is a list of strings indicating the
          permissions the user has within that company.
        items:
          description: permissions
          type: string
        type: array
        x-additionalPropertiesName: companyId
      type: object
    AuthSuccess:
      properties:
        token:
          type: string
      required:
        - token
      type: object
    UserType:
      description: The type of the user.
      enum:
        - agent
        - borrower
        - service
      type: string
    AuthType:
      enum:
        - basic
        - google
        - oneTimeCodeEmail
        - oneTimeCodeText
        - SAML
      type: string
    AuthValueType:
      enum:
        - email
        - username
        - phone
        - samlSubjectNameId
      type: string
    UserInfo:
      properties:
        data:
          properties:
            firstName:
              description: The user's first name.
              type: string
            lastName:
              description: The user's last name.
              type: string
            username:
              type: string
          type: object
      type: object
    AppDomainType:
      enum:
        - borrower
        - agent
        - help
        - admin
      type: string
    CompanyConfigBrandAssets:
      description: Brand assets and colors
      properties:
        colors:
          nullable: true
          properties:
            button:
              description: Hex color string (#000ccc) representing the button color
              nullable: true
              type: string
            lighten:
              description: Hex color string (#000ccc) representing the lighten color
              nullable: true
              type: string
            link:
              description: Hex color string (#000ccc) representing the link color
              nullable: true
              type: string
            primary:
              description: Hex color string (#000ccc) representing the primary color
              nullable: true
              type: string
            secondButton:
              description: >-
                Hex color string (#000ccc) representing the second button
                foreground color
              nullable: true
              type: string
            secondButtonBackground:
              description: >-
                Hex color string (#000ccc) representing the second button
                background color
              nullable: true
              type: string
            secondary:
              description: Hex color string (#000ccc) representing the secondary color
              nullable: true
              type: string
            tertiary:
              description: Hex color string (#000ccc) representing the tertiary color
              nullable: true
              type: string
          type: object
        copies:
          nullable: true
          properties:
            consent:
              description: HTML of the consent appearing in the footer
              nullable: true
              type: string
            disclosures:
              description: HTML of the disclosures appearing in the footer
              nullable: true
              type: string
          type: object
        logos:
          nullable: true
          properties:
            appCompactNavigation:
              description: >-
                URL for the compact/mobile navigation logo. Recommended
                dimensions: 200×32px.
              nullable: true
              type: string
            appLargeCentered:
              description: >-
                URL for the large centered logo (e.g. login, document upload).
                Recommended dimensions: 400×64px.
              nullable: true
              type: string
            appRegularNavigation:
              description: >-
                URL for the desktop navigation logo. Recommended dimensions:
                304×48px.
              nullable: true
              type: string
            primary:
              description: URL To the primary logo
              nullable: true
              type: string
            small:
              description: URL to the small logo
              nullable: true
              type: string
          type: object
      type: object
    CompanyConfigEmailStringOrObject:
      oneOf:
        - description: The email address
          example: jondoe@example.com
          title: Plain Email
          type: string
        - example:
            email: jondoe@example.com
            name: Jon Doe
          properties:
            email:
              type: string
            name:
              description: Name associated with email address
              nullable: true
              type: string
          title: Name + Email
          type: object
        - example:
            email: jondoe@example.com
            name: Jon Doe
          properties:
            address:
              example: jondoe@example.com
              type: string
            name:
              description: Name associated with email address
              nullable: true
              type: string
          title: Name + Address
          type: object
    CompanyConfigCommunication:
      properties:
        address_from:
          $ref: '#/components/schemas/AddressBase'
          description: The from address of letters sent out.
        email_from:
          oneOf:
            - $ref: '#/components/schemas/CompanyConfigEmailStringOrObject'
            - description: Configure email addresses from which to send email messages
              properties:
                non_transactional_from:
                  allOf:
                    - $ref: '#/components/schemas/CompanyConfigEmailStringOrObject'
                    - description: >
                        The email address from which all non-transactional
                        emails are sent.


                        A non-transactional email are those which are sent
                        manually by

                        an agent in the CRM.
                non_transactional_reply_to:
                  allOf:
                    - $ref: '#/components/schemas/CompanyConfigEmailStringOrObject'
                    - description: >
                        The email address marked as `reply-to` for sent
                        non-transactional emails.


                        A non-transactional email are those which are sent
                        manually by

                        an agent in the CRM.
                skipCGRules:
                  description: >-
                    can-interact will return `true` for this company without
                    checking Compliance Guard rules
                  type: boolean
                transactional_from:
                  allOf:
                    - $ref: '#/components/schemas/CompanyConfigEmailStringOrObject'
                    - description: >
                        The email address from which all transactional emails
                        are sent.


                        A transactional email are those which are NOT sent
                        manually by

                        an agent in the CRM.
                transactional_reply_to:
                  allOf:
                    - $ref: '#/components/schemas/CompanyConfigEmailStringOrObject'
                    - description: >
                        The email address marked as `reply-to` for sent
                        transactional emails.


                        A transactional email are those which are NOT sent
                        manually by

                        an agent in the CRM.
              title: From and Reply-To
              type: object
        email_inbound:
          description: Configure email addresses which may be used to receive messages.
          properties:
            monitored_emails:
              description: >
                Array of email addresses which can receive incoming email
                messages.


                An incoming email message will create a Taskrouter Task:

                `HandleInboundInteraction` or `HandleUnboundInboundInteraction`.
              items:
                $ref: '#/components/schemas/CompanyConfigEmailStringOrObject'
              type: array
            reject_others:
              default: false
              description: >
                If set to `true` then all email messages received by the email
                system

                which are NOT present in `monitored_emails` are considered

                "unmonitored email addresses".


                Unmonitored email addresses:

                - when receiving an email message DO NOT create Taskrouter
                Tasks.

                - when an email message is received, automatically reply with
                  an email saying that they have messaged an "unmonitored" email.
              type: boolean
          type: object
        enableInboundVoiceCall:
          description: >
            Set to `true` to enable inbound voice calls. Otherwise, inbound
            callers

            are read a voicemail is currently disabled message.


            (Note that other configuration settings must be set for voice calls

            to work properly.)
          type: boolean
        enableInboundWebChat:
          description: >
            Set to `true` to enable inbound webchats.


            When set to `true` the Contact Us page will display a link to start
            a webchat

            for logged-in borrowers.


            Note that `openHours` must also be configured for inbound webchats
            to work.
          type: boolean
        enable_two_way_texting:
          description: >
            Set to `true` to enable inbound text receipt and responses.
            Otherwise, texter

            receive response saying "This number is not monitored...".


            (To configure the autoresponse message see the config setting
            `support.textSupportDisabledMessage`)


            Inbound text messages will generate `replyToNewText`-type tasks.
          type: boolean
        text_from_number:
          description: The phone number to send text messages from.
          example: '+18085551234'
          type: string
      type: object
    CompanyConfigEvidence:
      properties:
        captureScreenshot:
          description: If `true`, capture payment screenshot for evidence collection.
          type: boolean
      type: object
    CompanyConfigLinks:
      properties:
        eSignDisclosureUrl:
          description: URL of lender's eSign Disclosure page
          format: url
          nullable: true
          type: string
        helpUrl:
          description: URL of lender's help page
          format: url
          nullable: true
          type: string
        privacyPolicyUrl:
          description: URL of lender's Privacy Policy page
          format: url
          nullable: true
          type: string
        termsOfUseUrl:
          description: URL of lender's Terms of Use page
          format: url
          nullable: true
          type: string
      type: object
    CompanyConfigOpenHours:
      description: |
        An object describing the times in which this company is "open".

        This is used in multiple places:
        - This is displayed on the contact us page.
        - When closed, phone calls are sent to voicemail or rejected.
        - When closed, webchats cannot be started.
      nullable: true
      properties:
        businessHours:
          nullable: true
          properties:
            holidays:
              description: >
                The list of holidays on which the company has special open
                hours. Holiday

                hours supercede the "normal" weekly hours.
              items:
                oneOf:
                  - description: >
                      An object describing the holiday.


                      Note that repeating, annual holidays cannot currently be
                      specified; you must

                      specify each year's holiday.
                    properties:
                      date:
                        description: >
                          An ISO 8601 date (not date-time) on which this holiday
                          occurs
                        example: '2024-04-01'
                        type: string
                      hours:
                        description: The hours in which the company is open on this holiday
                        example: 09:00-15:00
                        type: string
                      name:
                        description: The name of the holiday
                        example: April Fools Day
                        type: string
                    required:
                      - name
                    title: Custom Holiday
                    type: object
                  - description: >
                      An object indicating this company should match "standard"
                      holidays

                      for the country indicated.


                      Note that adding this will add multiple holidays to your
                      open hours

                      configuration.
                    properties:
                      hours:
                        description: >-
                          The hours in which the company is open on these
                          holidays
                        example: Closed
                        type: string
                      matchCountry:
                        description: >
                          The ISO 3166 2 or 3 character country code of the
                          country to match.


                          See:
                          https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes


                          The list of holidays for a country matches those used
                          by the python

                          package "Holidays".


                          See: https://python-holidays.readthedocs.io/
                        example: GB
                        type: string
                    required:
                      - matchCountry
                    title: Match Country Holidays
                    type: object
              nullable: true
              type: array
            normal:
              description: >
                A specially formatted string describing the open hours of the
                company.


                A day-time descriptor is a day or days of the week followed by a
                space " "

                and an "hours". With a "day" being the first three letters of
                the day of

                the week. With "hours" being either `Closed`, `24hours`, or

                a 24-hour time range like `9:00-18:00`.


                For example:

                - `"Mon-Wed 3:00-13:00"` indicates an open time from 3am to 1pm
                on
                  Monday, Tuesday, and Wednesday.
                - `"Fri 24hrs"` indicates that on Friday the company is open for
                24 hours.

                - `"Thu closed"` indicates on Thursday the company is closed all
                day.


                Day-time descriptors can be combined with a `;` to fully define
                a week

                of open times.


                If no open hours are configured the company is considered always
                closed.
              example: Mon 24hrs; Tue-Fri 9:00-18:00; Sat-Sun Closed
              nullable: true
              type: string
          type: object
      type: object
    CompanyConfigPaymentTypes:
      description: Controls what payment instrument types are allowed.
      properties:
        ach:
          default: false
          type: boolean
        achVerification:
          properties:
            microdeposit:
              description: >-
                Microdeposit verification is required when creating bank
                accounts without using Plaid.
              type: boolean
            plaid:
              description: Plaid account creation is allowed.
              type: boolean
          type: object
        balanceCheck:
          properties:
            plaid:
              description: Allow Plaid balance checks.
              type: boolean
          type: object
        check:
          default: false
          type: boolean
        creditCard:
          default: false
          type: boolean
        debitCard:
          default: false
          type: boolean
        moneyOrder:
          default: false
          type: boolean
        paymentNetwork:
          default: false
          type: boolean
        payroll:
          default: false
          type: boolean
        wire:
          default: false
          type: boolean
      type: object
    CompanyConfigStatements:
      properties:
        defaultStatementChannel:
          enum:
            - email
            - mail
          type: string
        isMailStatementAllowed:
          description: >
            Whether borrowers can choose mail as their delivery method for
            statements.
          type: boolean
        overdueAmountInMinPaymentOverride:
          description: >
            If true, include the overdue amount in the min payment calculation
            during statement generation. This is also the default.


            If false, do not include the overdue amount in the min payment
            calculation during statement generation.
          nullable: true
          type: boolean
      type: object
    CompanyConfigSupport:
      description: Customer support
      properties:
        departmentName:
          nullable: true
          type: string
        email:
          nullable: true
          type: string
        enableVoicemailWhenClosed:
          description: >
            Set to `true` to enable the leaving of voicemails when a customer
            calls

            while phone support is closed.
          type: boolean
        enableVoicemailWhenNoAgents:
          description: >
            Set to `true` to enable leaving of voicemails when a customer calls

            when there are no agents available to answer the call.


            If `false` or left unset the caller will remain on hold indefinitely
            until

            an agent makes themselves available.
          type: boolean
        mailingAddress:
          $ref: '#/components/schemas/AddressBase'
          description: The mailing address of the support department.
          nullable: true
        outboundCallRecordingConsentScript:
          description: >
            Message to read to caller when making an outbound call to obtain
            consent

            to record the call.
          type: string
        phone:
          nullable: true
          type: string
        phoneSupportClosedLeaveVoicemailMessage:
          description: >
            Message to read to caller when phone support is closed, and they may
            leave a message.
          type: string
        phoneSupportClosedMessage:
          description: >
            Message to read to caller when phone support is closed (and
            voicemails

            cannot be left because `enableVoicemailWhenClosed=false`)
          type: string
        phoneSupportDisabledMessage:
          description: >
            Message to read in response to an inbound call when phone support is
            disabled.

            (Phone support is disabled with the company config setting:
            `communication.enableInboundVoiceCall=false`)
          type: string
        phoneSupportNoAgentsLeaveVoicemailMessage:
          description: |
            Message to read to caller when there are no agents available, and
            they may leave a message.
          type: string
        phoneSupportPleaseHoldMessage:
          description: >
            Message to read to inbound callers when being put on hold. This
            message is read

            after the recording consent message.
          type: string
        privacyPolicyUrl:
          description: URL of the privacy policy notice.
          nullable: true
          type: string
        recordAllInboundVoiceCalls:
          description: >
            Set to `true` to record all inbound voice calls. Otherwise, calls
            can

            be manually recorded on an individual basis by an agent.
          type: boolean
        recordAllOutboundVoiceCalls:
          description: >
            Set to `true` to record all outbound voice calls. Otherwise, calls
            can

            be manually recorded on an individual basis by an agent.
          type: boolean
        textSupportClosedPleaseWaitMessage:
          description: >
            Message to send in response to initial inbound text message which
            starts a text message

            conversation when phone support is closed.
          type: string
        textSupportDisabledMessage:
          description: >
            Message to send in response to an inbound text message when text
            support is disabled.

            (Text support is disabled with the company config setting:
            `communication.enable_two_way_texting=false`)
          type: string
        textSupportFindNewAgentPleaseWaitMessage:
          description: >
            Message to send in response to an inbound text message to an already
            active conversation,

            in which there is NOT already an agent.
          type: string
        textSupportPleaseWaitMessage:
          description: >
            Message to send in response to initial inbound text message which
            starts a text message

            conversation.
          type: string
        textSupportRejectUnknownNumberMessage:
          description: >
            Message to send in response to an inbound text message when
            rejecting contact from

            an unknown number.
          type: string
      type: object
    CompanyConfigTimezone:
      description: >
        The timezone of the company.


        It can be any IANA timezone from the [timezone
        database](https://data.iana.org/time-zones/releases/).


        Note that this value should be a timezone and *NOT* a UTC Offset. A
        timezone is associated with

        a geographic place / political entity (e.g., "America/Los_Angeles"), a
        UTC Offset

        is just a count of number of hours difference from UTC.
      nullable: true
      type: string
    HiddenOrNull:
      enum:
        - hidden
      nullable: true
      type: string
    AgentDashboardTools:
      properties:
        dashboardToolDetails:
          description: The details required for Peach to expose the agent tools to agents.
          items:
            properties:
              name:
                description: The name of the tool displayed to the agent.
                type: string
              url:
                description: >
                  The url associated with the agent tool. This controls the
                  destination where the agent is taken when they access

                  the tool.


                  Note: when creating the url, there are parameters that the
                  system will be able to parse and automatically

                  fill in. They are {borrowerId}, {externalBorrowerId},
                  {loanId}, {loanExternalId}, {loanPeachPublicId}, and

                  {borrowerPeachPublicId}
                type: string
            type: object
          type: array
        enabled:
          default: false
          description: >-
            Determines whether agent tools will be shown in the loan options
            menu to the agent.
          type: boolean
      type: object
    ShownOrNull:
      enum:
        - shown
      nullable: true
      type: string
    CompanyConfigUi:
      description: |
        Configure UI, including the visibility or ordering of various UI
        elements.
        Each element is either hidden or visible by default.
        For elements shown by default, hide them by setting their value
        to `hidden`.
        For elements hidden by default, show them by setting their value
        to `show`.

        These elements are hidden by default:

        - directPaymentToDraw

        All other elements are shown by default.
      properties:
        accountSettings:
          $ref: '#/components/schemas/HiddenOrNull'
        accountSettingsPage:
          properties:
            additionalContacts:
              $ref: '#/components/schemas/HiddenOrNull'
            commPreferences:
              $ref: '#/components/schemas/HiddenOrNull'
            contactInformation:
              $ref: '#/components/schemas/HiddenOrNull'
            paymentMethods:
              $ref: '#/components/schemas/HiddenOrNull'
            profile:
              $ref: '#/components/schemas/HiddenOrNull'
          type: object
        accountSummaryPage:
          properties:
            balancesDetails:
              $ref: '#/components/schemas/HiddenOrNull'
            cardDetails:
              $ref: '#/components/schemas/HiddenOrNull'
            loanTerms:
              $ref: '#/components/schemas/HiddenOrNull'
            merchantDetails:
              $ref: '#/components/schemas/HiddenOrNull'
            promotions:
              $ref: '#/components/schemas/HiddenOrNull'
            summary:
              $ref: '#/components/schemas/HiddenOrNull'
          type: object
        agentDashboardTools:
          $ref: '#/components/schemas/AgentDashboardTools'
        analyticsScript:
          description: >-
            The HTML portion of script codes that loads analytics related code.
            The code is merged at the bottom of the main HTML page. Double
            quotes (") should be encoded by prefixing it with a "\\"
            (backslash).
          type: string
        caseTypeOrdering:
          description: |
            Definitions for case type selection dropdown grouping and
            ordering. Categories and tasks are ordered as given.
          items:
            properties:
              caseTypes:
                description: Array of case type Peach IDs
                items:
                  $ref: '#/components/schemas/AnyId'
                type: array
              category:
                description: Category name
                type: string
            type: object
          type: array
        contactUs:
          $ref: '#/components/schemas/HiddenOrNull'
        dashboard:
          description: |
            Configuration for the embedded Metabase dashboards displayed in CRM.
          properties:
            cases:
              $ref: '#/components/schemas/HiddenOrNull'
              description: Hide the cases embedded Metabase dashboard in CRM.
            interactions:
              $ref: '#/components/schemas/HiddenOrNull'
              description: Hide the interactions embedded Metabase dashboard in CRM.
          type: object
        directPaymentToDraw:
          $ref: '#/components/schemas/ShownOrNull'
          description: |
            Allow customers to direct manual payments toward a specific draw.
            Only applicable to LOC.
        eSignDisclosure:
          $ref: '#/components/schemas/HiddenOrNull'
        favicon:
          description: URL of the company favicon.
          nullable: true
          type: string
        headScripts:
          description: >-
            The HTML portion that is loaded at the top of the tag of the main
            HTML page. Can be used to inject additional scripts that must be
            loaded at the start, like UserWay's ADA compliance widget.
          type: string
        help:
          $ref: '#/components/schemas/HiddenOrNull'
        loanOptions:
          properties:
            changeDueDate:
              $ref: '#/components/schemas/HiddenOrNull'
            changeNickname:
              $ref: '#/components/schemas/HiddenOrNull'
            drawFunds:
              $ref: '#/components/schemas/HiddenOrNull'
            getPayoffStatement:
              $ref: '#/components/schemas/HiddenOrNull'
            makePayment:
              $ref: '#/components/schemas/HiddenOrNull'
            manageAutopay:
              $ref: '#/components/schemas/HiddenOrNull'
            managePaymentMethods:
              $ref: '#/components/schemas/HiddenOrNull'
          type: object
        loginPage:
          properties:
            fallbackAuthLink:
              $ref: '#/components/schemas/HiddenOrNull'
              description: >
                If `hidden`, the UI will hide hide the "Try another way to
                login" link.
          type: object
        makePaymentPage:
          properties:
            remainingBalance:
              $ref: '#/components/schemas/HiddenOrNull'
          type: object
        manageAutopayPage:
          properties:
            minimumPaymentDue:
              $ref: '#/components/schemas/HiddenOrNull'
            statementBalance:
              $ref: '#/components/schemas/HiddenOrNull'
          type: object
        managePaymentMethodsPage:
          properties:
            agent:
              properties:
                check:
                  $ref: '#/components/schemas/HiddenOrNull'
                creditCard:
                  $ref: '#/components/schemas/HiddenOrNull'
                debitCard:
                  $ref: '#/components/schemas/HiddenOrNull'
                deleteButton:
                  $ref: '#/components/schemas/HiddenOrNull'
                moneyOrder:
                  $ref: '#/components/schemas/HiddenOrNull'
                paymentNetwork:
                  $ref: '#/components/schemas/HiddenOrNull'
                payroll:
                  $ref: '#/components/schemas/HiddenOrNull'
                wire:
                  $ref: '#/components/schemas/HiddenOrNull'
              type: object
            borrower:
              properties:
                check:
                  $ref: '#/components/schemas/HiddenOrNull'
                creditCard:
                  $ref: '#/components/schemas/HiddenOrNull'
                debitCard:
                  $ref: '#/components/schemas/HiddenOrNull'
                deleteButton:
                  $ref: '#/components/schemas/HiddenOrNull'
                moneyOrder:
                  $ref: '#/components/schemas/HiddenOrNull'
                paymentNetwork:
                  $ref: '#/components/schemas/HiddenOrNull'
                payroll:
                  $ref: '#/components/schemas/HiddenOrNull'
                wire:
                  $ref: '#/components/schemas/HiddenOrNull'
              type: object
          type: object
        mobileDisclosures:
          $ref: '#/components/schemas/HiddenOrNull'
          description: |
            Hide the borrower portal disclosures on mobile devices.
        mobileFooter:
          $ref: '#/components/schemas/HiddenOrNull'
          description: |
            Hide the borrower portal footer on mobile devices.
        mobileHeader:
          $ref: '#/components/schemas/HiddenOrNull'
          description: |
            Hide the borrower portal header on mobile devices.
        phoneDisclosureNote:
          $ref: '#/components/schemas/ShownOrNull'
          description: >
            Controls whether a fixed disclosure note is shown on the Borrower
            Portal when a borrower changes their primary or personal phone
            number. Absent or null means hidden (default).
        privacyPolicy:
          $ref: '#/components/schemas/HiddenOrNull'
        projectSlug:
          description: >-
            The company project slug used to serve the UI. Please do NOT change
            it without coordinating with engineering.
          type: string
        signOut:
          $ref: '#/components/schemas/HiddenOrNull'
        termsOfUse:
          $ref: '#/components/schemas/HiddenOrNull'
        websiteTitle:
          description: >-
            The title that will be shown when the front end loads before the
            rest of the code loads.
          nullable: true
          type: string
      type: object
    FrontendPreauthBootstrap:
      properties:
        appDomainType:
          $ref: '#/components/schemas/AppDomainType'
        authType:
          $ref: '#/components/schemas/AuthType'
        authValueType:
          $ref: '#/components/schemas/AuthValueType'
        company:
          description: >
            `IMPORTANT:` The values in here _DO NOT directly correspond_ to the
            values returned

            by the `/api/companies/{companyId}` endpoint. These values are
            _similar_ but

            transformed for public consumption.
          properties:
            agentAuthType:
              $ref: '#/components/schemas/AuthType'
            agentAuthValueType:
              $ref: '#/components/schemas/AuthValueType'
            borrowerAuthType:
              $ref: '#/components/schemas/AuthType'
            borrowerAuthValueType:
              $ref: '#/components/schemas/AuthValueType'
            brandAssets:
              $ref: '#/components/schemas/CompanyConfigBrandAssets'
            brandName:
              type: string
            communication:
              $ref: '#/components/schemas/CompanyConfigCommunication'
            defaultVerificationTypeId:
              type: string
            domainName:
              type: string
            evidence:
              $ref: '#/components/schemas/CompanyConfigEvidence'
            forceCaseIdOnAgentActions:
              type: boolean
            id:
              type: string
            legalName:
              type: string
            links:
              $ref: '#/components/schemas/CompanyConfigLinks'
            name:
              type: string
            openHours:
              $ref: '#/components/schemas/CompanyConfigOpenHours'
            paymentTypes:
              $ref: '#/components/schemas/CompanyConfigPaymentTypes'
            shortDomainName:
              type: string
            showPoweredByPeach:
              nullable: true
              type: boolean
            statements:
              $ref: '#/components/schemas/CompanyConfigStatements'
            support:
              $ref: '#/components/schemas/CompanyConfigSupport'
            tasks:
              properties:
                enableCaseOwnership:
                  type: boolean
              type: object
            timezone:
              $ref: '#/components/schemas/CompanyConfigTimezone'
            ui:
              $ref: '#/components/schemas/CompanyConfigUi'
          type: object
        ssoLoginUrl:
          description: >
            The SSO login URL to send the requester to if this is an
            SSO-authenticated application,

            otherwise return `null`.
          nullable: true
          type: string
        userType:
          $ref: '#/components/schemas/UserType'
      type: object
    NewPaginator:
      properties:
        count:
          description: Number of items returned by the current request.
          readOnly: true
          type: integer
        nextUrl:
          description: URL of the next set of results.
          nullable: true
          readOnly: true
          type: string
        previousUrl:
          description: URL of the previous set of results.
          nullable: true
          readOnly: true
          type: string
        status:
          description: HTTP status code.
          type: integer
        total:
          description: Total number of items in this result.
          readOnly: true
          type: integer
      type: object
    BaseMixin:
      properties:
        createdAt:
          format: date-time
          readOnly: true
          type: string
        deletedAt:
          format: date-time
          nullable: true
          readOnly: true
          type: string
        id:
          readOnly: true
          type: string
        updatedAt:
          format: date-time
          nullable: true
          readOnly: true
          type: string
      type: object
    BaseWithExternalIdMixin:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            externalId:
              description: >
                A lender's identifier for an object.


                After the object is successfully created, a lender can use ID or
                externalId identifiers to fetch the object.


                To fetch the object using externalId you need to add `ext-` to
                the URL.


                Note: Don't add ext- to the identifier value. For example: if
                the external identifier is `ABCDE`, then pass externalId=ABCDE
                and NOT ext-ABCDE when creating the object.
              maxLength: 200
              minLength: 1
              nullable: true
              type: string
          type: object
    BulkSenderInteractionChannel:
      description: >
        The channel to which the bulk sender will send.


        If no channel is specified the campaign will send to all channels with a
        defined template.


        **WARNING**: Only `mail`, `text`, and `email` are compatible with the
        campaigns system.
      enum:
        - voice
        - email
        - fax
        - text
        - chat
        - mail
        - gui
        - document
      nullable: true
      type: string
    InteractionSubject:
      description: >
        The subject of the interaction. The subject identifies the category of
        the content

        in the message.


        Most subjects have an associated implicit theme. e.g.,
        `loanOverdueFirstNotice` has

        a theme of `opsCollDebt`. For these subjects it is not necessary to
        specify a theme.


        Some subjects like `freeForm` and `custom<N>` do not have an implicit
        theme. When

        using these subjects you must specify a `theme`.


        **DEPRECATED**: `locStatementGenerated` and `locStatementRegenerated`
        are deprecated.

        They will be automatically converted into `statementGenerated` and
        `statementRegenerated`

        respectively. You should switch to use those subjects directly.


        **DEPRECATED**: `failedSettlementPeach` is deprecated. This was always a
        subject used by 

        the Peach application internally, and will no longer be used. Attempts
        to set this

        subject will be rejected with a 400 error.
      enum:
        - annualPrivacyPolicyNotice
        - autopayAgreement
        - autopayAmountChanged
        - autopayCanceledBySystem
        - autopayEnabled
        - autopayEnableReminder
        - autopayPaymentCanceled
        - autopayPaymentMethodUpdated
        - autopayPaymentReminder
        - autopayPaymentRescheduled
        - cardExpiresReminder
        - caseEscalation
        - ceaseCommunicationAcknowledgement
        - ceaseCommunicationRefuseToPay
        - confirmationCode
        - contactTakeover
        - creditNegativeInfoReported
        - creditPositiveInfoReported
        - custom1
        - custom2
        - custom3
        - custom4
        - custom5
        - custom6
        - custom7
        - custom8
        - custom9
        - custom10
        - custom11
        - custom12
        - custom13
        - custom14
        - custom15
        - custom16
        - custom17
        - custom18
        - custom19
        - custom20
        - custom21
        - custom22
        - custom23
        - custom24
        - custom25
        - custom26
        - custom27
        - custom28
        - custom29
        - custom30
        - custom31
        - custom32
        - custom33
        - custom34
        - custom35
        - custom36
        - custom37
        - custom38
        - custom39
        - custom40
        - custom41
        - custom42
        - custom43
        - custom44
        - custom45
        - custom46
        - custom47
        - custom48
        - custom49
        - custom50
        - custom51
        - custom52
        - custom53
        - custom54
        - custom55
        - custom56
        - custom57
        - custom58
        - custom59
        - custom60
        - custom61
        - custom62
        - custom63
        - custom64
        - custom65
        - custom66
        - custom67
        - custom68
        - custom69
        - custom70
        - custom71
        - custom72
        - custom73
        - custom74
        - custom75
        - custom76
        - custom77
        - custom78
        - custom79
        - custom80
        - custom81
        - custom82
        - custom83
        - custom84
        - custom85
        - custom86
        - custom87
        - custom88
        - custom89
        - custom90
        - custom91
        - custom92
        - custom93
        - custom94
        - custom95
        - custom96
        - custom97
        - custom98
        - custom99
        - custom100
        - debtValidationNotice
        - debtValidationNoticeArizona
        - debtValidationNoticeAutomatic
        - debtValidationNoticeNYCYonkers
        - debtValidationNoticePuertoRico
        - deceasedConfirmationOfPayoff
        - deceasedNoticeToRepresentative
        - deceasedNotificationUponDeath
        - disputeOfDebtConfirmed
        - disputeOfDebtSubmitDocumentation
        - disputeOfDebtSubmitDocumentationReminder
        - disputeOfDebtUnableToConfirm
        - disputeOfDebtUnableToResolve
        - documentUploadFailed
        - downpaymentFailed
        - drawFundsDisclosure
        - electronicConsentOptOut
        - failedSettlementInvestor
        - failedSettlementPeach
        - freeForm
        - freeFormBranded
        - futurepayCanceled
        - futurepayPaymentDueReminder
        - identityTheftIncompleteDocumentation
        - identityTheftNotValidated
        - identityTheftSubmitDocumentation
        - identityTheftSubmitDocumentationFirstReminder
        - identityTheftSubmitDocumentationSecondReminder
        - identityTheftValidated
        - letterReturnedToSender
        - loanAccelerated
        - loanCanceled
        - loanChargedOffUnsecured
        - loanDetails
        - loanFeeCharged
        - loanFreeze
        - loanManualPaymentDisclosure
        - loanOverdueFifthNotice
        - loanOverdueFirstNotice
        - loanOverdueFourthNotice
        - loanOverdueSecondNotice
        - loanOverdueSixthNotice
        - loanOverdueThirdNotice
        - loanPaidOff
        - loanPaymentScheduleChanged
        - loanPayoffStatement
        - loanRefundProcessed
        - loanRightToCurePersonalUnsecured
        - loanRightToCurePersonalUnsecuredColorado
        - loanRightToCurePersonalUnsecuredDC
        - loanRightToCurePersonalUnsecuredIowa
        - loanRightToCurePersonalUnsecuredKansas
        - loanRightToCurePersonalUnsecuredMaine
        - loanRightToCurePersonalUnsecuredMissouri
        - loanRightToCurePersonalUnsecuredSouthCarolina
        - loanRightToCurePersonalUnsecuredWestVirginia
        - loanRightToCurePersonalUnsecuredWisconsin
        - loanTermsChangeAgreement
        - loanUnfreeze
        - locCreditLimitChanged
        - locInterestRateChanged
        - locLineClosed
        - locStatementGenerated
        - locStatementRegenerated
        - loginFirstPaymentReminder
        - microdepositFailed
        - microdepositProcessing
        - microdepositReminder
        - oneTimeCode
        - paydayConsumerRightsNotice
        - paydayFirstPaymentWithdrawal
        - paymentDisputed
        - paymentDueDateReminder
        - paymentFailed
        - paymentMethodAdded
        - paymentMethodUpdated
        - paymentProcessing
        - paymentRescheduled
        - paymentReversalFailed
        - paymentReversalProcessing
        - paymentSuccessful
        - payoffStatementDocument
        - promiseToPayPeriodKept
        - promiseToPayPeriodMissed
        - promiseToPayPlanCanceled
        - promiseToPayPlanCreated
        - promoProgramCanceled
        - promoProgramEligibilityAtRisk
        - promoProgramExercised
        - promoProgramReminder
        - reimbursementFailed
        - reimbursementProcessed
        - reimbursementScheduled
        - scraApplicationDenied
        - scraBenefitsApplied
        - scraBenefitsExpiringNotice
        - scraCGFlaggedDocumentRequest
        - scraServicemanNotifiedDocumentRequest
        - settlementOffer
        - settlementOfferFirstReminder
        - statement
        - statementLOC
        - statementGenerated
        - statementRegenerated
        - unmonitoredEmailAddress
        - updateBankAccountConnection
      type: string
    InteractionTheme:
      description: >
        The reason why an interaction occurred.


        For example:

        - An outbound debt collection call should be marked as `opsCollDebt`.

        - An annual privacy policy update email should be marked as
        `opsServicing`.

        - A customer service response to borrower's inquiry should be marked as
        `opsServicing`.


        **DEPRECATED**: `inbBug`, `inbHumanLove`, and
        `opsServicingNegativeCreditReportNotice` are deprecated:

        you cannot create or update interactions to have these values.
      enum:
        - agentNotification
        - opsCollDebt
        - opsCollLocateBorrower
        - opsCollVerifyEmployment
        - opsCollContactEmployerNotice
        - opsServicingDebtValidation
        - opsServicingNegativeCreditReportNotice
        - opsServicingTimeBarredNotice
        - opsServicing
        - opsAccountCredentials
        - inbMissingFeature
        - inbEducation
        - inbBug
        - inbRequest
        - inbHumanLove
        - inbUnknown
        - inbOther
        - inbServicing
        - inbCollections
        - inbPayments
        - inbFraud
        - inbGeneralInquiry
      nullable: true
      type: string
    BulkSender:
      allOf:
        - $ref: '#/components/schemas/BaseWithExternalIdMixin'
        - properties:
            interactionChannel:
              $ref: '#/components/schemas/BulkSenderInteractionChannel'
            interactionSubject:
              $ref: '#/components/schemas/InteractionSubject'
            interactionTheme:
              $ref: '#/components/schemas/InteractionTheme'
          type: object
    BulkSenderCreate:
      allOf:
        - $ref: '#/components/schemas/BaseWithExternalIdMixin'
        - properties:
            interactionChannel:
              $ref: '#/components/schemas/BulkSenderInteractionChannel'
            interactionSubject:
              $ref: '#/components/schemas/InteractionSubject'
            interactionTheme:
              $ref: '#/components/schemas/InteractionTheme'
          required:
            - interactionSubject
          type: object
    LoansFromCollCase:
      description: >
        If `true`, look up the associated collections case for this borrower,

        and, if it exists, use the loans in collections as input to this
        endpoint.


        This cannot be used in conjunction with `loanId` or `loanIds` fields.


        If there are no loans in collections for this borrower (i.e., no
        collections case), 

        then this endpoint executes normally as if `loanIds` were not provided.


        Note:

        - Borrowers may only have one collections case at a time.

        - This will mostly only be useful with collections-related themes:
        `opsCollDebt`,
          `opsCollLocateBorrower`, `opsCollVerifyEmployment`, and `opsCollContactEmployerNotice`,
          but it is permissible to use with other themes.
      type: boolean
    ContactExporter:
      description: |
        A contact exporter represents instructions on how to transform a
        campaign run into a finalized list.
      properties:
        checkCanInteractData:
          description: >
            If set, screen contacts through Compliance Guard using provided
            data.
          nullable: true
          properties:
            isAutodialed:
              default: false
              description: >
                `true` if an autodialed call. If no value is passed, we'll
                assume

                isAutodialed=`false`—meaning a manual call was performed.


                For more information on why this is important reference the

                Telephone Consumer Protection Act (TCPA).
              nullable: true
              type: boolean
            loansFromCollCase:
              $ref: '#/components/schemas/LoansFromCollCase'
            theme:
              $ref: '#/components/schemas/InteractionTheme'
          type: object
        columnSettings:
          description: >
            A list of dictionaries where each dictionary specifies a field to
            include as a column in the result

            file along with optional output column name.
          items:
            properties:
              field:
                description: >
                  The field name of the data source.


                  All fields are relative to _the contact_. i.e., the `id` field
                  is the contact's ID, and not

                  the associated borrower's ID.


                  Note that fields prefixed with `borrower...` are fields which
                  will always return information

                  about this contact's associated borrower. For example, if the
                  contact has `affiliation=spouse`,

                  the `borrowerDateOfBirth` field will contain the borrower's
                  date of birth, and NOT contain the

                  borrower's spouse's date of birth.


                  Only the following values are currently supported:


                  ## Contact Metadata


                  - `affiliation` - This contact's affiliation with the
                  borrower. For example, if this were a borrower's
                    lawyer contact, this value will be `legal`; Or, if this were a borrower's own contact it would be `self`.
                  - `externalId` - This contact's external ID, or `null` if it
                  does not have one.

                  - `id` - This contact's ID—starts with `CT-...`

                  - `label` - This contact's label—one of: `personal`, `home`,
                  `work`, `military`

                  - `name` - This contact's full name.

                  - `status` - This contact's status—one of: `primary`,
                  `secondary`, `additional`, `archived`


                  ## Associated Borrower Metadata


                  - `borrowerCrmUrl` - The associated borrower's management page
                  URL in the Peach CRM

                  - `borrowerDateOfBirth` - The associated borrower's date of
                  birth, formatted like YYYY/MM/DD

                  - `borrowerFirstName` - The associated borrower's first name.

                  - `borrowerId` - The associated borrower's ID—starts with
                  `BO-...`.

                  - `borrowerLastName` - The associated borrower's last name.

                  - `borrowerMaidenLastName` - The associated borrower's maiden
                  name.

                  - `borrowerMiddleName` - The associated borrower's middle
                  name.

                  - `borrowerPortalUrl` - The associated borrower's loan portal
                  page URL

                  - `borrowerPreferredFirstName` - The associated borrower's
                  preferred first name.

                  - `borrowerPrimaryAddress` - The primary address for the
                  associated borrower.


                  ## Collections Related


                  - `collectionsAmountOverdue` - The total amount overdue for
                  the active collections case, or
                    blank if there is no active case. (This is the same value as in the `totalAmounts.overdue`
                    field of the active collections case.)
                  - `collectionsCaseCrmUrl` - A URL to the active collection
                  case in the Peach CRM for the
                    associated borrower; or blank if there is no active case.
                  - `consentsToAutodialedColl` — The value for the
                  `AutodialedColl` consent. This consent
                    identifies if the associated borrower has consented to received autodialed collection
                    calls. If consent has been granted this value is `"consented"`, otherwise `"revoked"`. (If
                    there was an error fetching this information this field could be `"error"`.) See
                    <a href="/tags/Consent">Consents</a> for more information on consents.
                type: string
              outputName:
                description: >
                  Name of the column to use in exported CSV file. If not
                  specified, then

                  use the `field` name.
                nullable: true
                type: string
            type: object
          type: array
        contactMatchingCriteria:
          description: >
            Settings for selecting a person's contact information to include in
            export data. An empty attribute

            is not allowed. Multiple attributes act as "AND" filters. E.g., a
            contact must

            have an affiliation of "self" AND a label of "home" in order to
            match. If multiple

            values are specified for an attribute, the values act as "OR"
            conditions within that attribute.
          properties:
            affiliation:
              description: >
                Array of person's contact affiliations. If multiple values are
                provided, values act as OR condition.
              items:
                enum:
                  - self
                  - spouse
                  - parent
                  - guardian
                  - executer
                  - administrator
                  - otherRelative
                  - legal
                  - businessOwner
                  - businessExecutive
                  - businessEmployee
                type: string
              type: array
            contactType:
              description: >
                Array of person's contact types. Currently only "Phone" is
                supported.
              items:
                enum:
                  - phone
                type: string
              type: array
            label:
              description: >
                Array of person's contact labels. If multiple values are
                provided, values act as OR condition.
              items:
                enum:
                  - personal
                  - home
                  - work
                  - military
                type: string
              type: array
            status:
              description: >
                Array of person's contact statuses. The values of this
                enumeration are used for getting the contact

                with the highest priority. Items with lower number have higher
                priority. If multiple values are

                provided, values act as OR condition.
              items:
                enum:
                  - primary
                  - secondary
                  - additional
                  - archived
                type: string
              type: array
          type: object
      type: object
    BorrowerCampaign:
      description: >
        A borrower campaign is part of a system for exporting contact
        information

        for borrowers or sending communications to borrowers in bulk.


        A borrower campaign objects represents this campaign. It contains the
        information specifying from

        where a campaign derives its input borrower list, a schedule for
        execution, and the format

        for exporting that list.


        The input borrowers list is defined by a Redash query. See
        `redashQueryUrl` for details.
      properties:
        bulkSenderId:
          description: |
            The ID of an existing bulk sender to use for this campaign.
          nullable: true
          type: string
        contactExporterId:
          description: |
            The ID of an existing contact exporter to use for this campaign.
          nullable: true
          type: string
        redashApiKey:
          description: |
            The API key to use for querying Redash.

            You can find your API key at https://{YOUR_REDASH_DOMAIN}/users/me.
          nullable: true
          type: string
        redashQueryUrl:
          anyOf:
            - description: >
                The URL of the Redash query from which to build the input.


                The URL should look like
                https://{YOUR_REDASH_DOMAIN}/queries/{QUERY_ID}.


                The output of this query is fed into the campaign system as
                input for

                each new campaign run. (Note that the query is re-run on each
                campaign run.)


                The query must produce a query result with at least the column
                `borrowerId`, e.g.:


                ```

                borrowerId

                4,

                5,

                ...

                ````


                Note that it is valid to use either public IDs (like
                `BO-XXXX-XXXX`) or internal

                database IDs (integers).


                For a detailed description of how to format your query result
                see other options

                for this `redashQueryUrl` property.
              example: https://acme-rd.peach.finance/queries/48
              maxLength: 150
              nullable: true
              title: General
              type: string
            - description: >
                Running a campaign with a bulk sender.


                The campaign bulk sender takes a Redash query result and maps

                each row to a call to

                <a href="#peach.communicator.handlers.handle_send">the
                `/communcator/send` endpoint</a>.


                ## Passing Custom Context Variables


                To pass data to the `context` field of the `/communcator/send`
                endpoint, you can

                include `context.<...>` prefixed fields in the query result.


                A query result which looks like this:


                ```

                borrowerId,context.animal,context.utensil

                100,bear,spoon

                103,beaver,fork

                ...

                ```


                ...will end up in requests to `/communicator/send` endpoint
                like:


                ```

                {
                  "borrowerId": "BO-XXXX-XXXX", // 100
                  "context": {
                    "animal": "bear",
                    "utensil": "spoon"
                  }
                }

                ```


                and


                ```

                {
                  "borrowerId": "BO-YYYY-YYYY",  // 103
                  "context": {
                    "animal": "beaver",
                    "utensil": "fork"
                  }
                }

                ```


                ## Calculated Context Variables


                Certain preconfigured interaction subjects will

                automatically have their contexts populated if they are provided

                with the appropriate input data.


                For instance, a bulk sender with `autopayEnableReminder` subject
                will

                automatically have these variables calculated and passed as
                context to

                `/communicator/send`: `paymentDate`, `paymentAmount` and
                `overdueAmount`.


                For details on an individual interaction subject's requirements
                see the other

                options for this `redashQueryUrl` property.
              maxLength: 150
              nullable: true
              title: bulkSender
              type: string
            - description: >
                Running a campaign with a bulk sender subject of
                `paymentDueDateReminder`:


                These messages are intended to remind a borrower they have a
                payment due.


                ## Query Result Formatting

                The Redash query results should look like:


                ```

                borrowerId,loanId,loanPeriodId,

                100,200,300,

                103,205,305,

                ...

                ```


                > Note that it is valid to use either public IDs (like
                `BO-XXXX-XXXX`) or internal

                database IDs (integers).


                ## Calculated Context Variables


                The following context variables are automatically calculated and
                passed to the

                `context` field of `/communcator/send`: `overdueAmount`,
                `paymentDate`, `paymentDays`, `paymentAmount`,
                `fulfilledAmount`, `remainingAmount`.


                ## Targeting

                You may select any borrower-loan and loan period. You MUST only
                select

                loan periods in the future.


                *WARNING:* Minimal sanity-checking is performed on which
                borrower-loan and

                loan periods are selected. If you select invalid values, e.g., a
                loan period ID

                in the past, then a message may still be sent.
              maxLength: 150
              nullable: true
              title: 'bulkSender: paymentDueDateReminder'
              type: string
            - description: >
                Running a campaign with a bulk sender subject of
                `loanOverdue{Nth}Notice`:


                These messages are intended to remind a borrower of overdue
                loans.


                ## Query Result Formatting

                The Redash query results should look like:


                ```

                borrowerId,loanId

                100,200,

                103,205,

                ...

                ```


                > Note that it is valid to use either public IDs (like
                `BO-XXXX-XXXX`) or internal

                database IDs (integers).


                ## Calculated Context Variables


                The following context variables are automatically calculated and
                passed to the

                `context` field of `/communcator/send`: `overdueAmount`,
                `daysOverdue`.


                ## Targeting

                You MUST select borrower-loans which are in an overdue state.


                *WARNING:* Minimal sanity-checking is performed on which
                borrower-loan you are targeting.

                If you select an invalid borrower-loan, e.g., a loan that is not
                overdue

                then a message may still be sent.
              maxLength: 150
              nullable: true
              title: 'bulkSender: loanOverdueNthNotice'
              type: string
            - description: >
                Running a campaign with a bulk sender subject of
                `autopayPaymentReminder`:


                These messages are intended to remind borrowers of upcoming
                payments

                scheduled via the autopay system.


                ## Query Result Formatting

                The Redash query results should look like:


                ```

                borrowerId,loanId

                100,200,

                103,205,

                ...

                ```


                > Note that it is valid to use either public IDs (like
                `BO-XXXX-XXXX`) or internal

                database IDs (integers).


                ## Calculated Context Variables


                The following context variables are automatically calculated and
                passed to the

                `context` field of `/communcator/send`: `overdueAmount`,
                `paymentDate`, `paymentDays`, `paymentAmount`,
                `fulfilledAmount`, `remainingAmount`.


                ## Targeting

                You MUST provide any target borrower-loans. For performance
                reasons you

                should try to target loans which have autopay enabled.


                If autopay is enabled for the given borrower-loan combination
                specified in

                the query results row, then a message is sent if and only if
                there is

                an upcoming scheduled payment configured. A message is only sent
                for the *next*

                upcoming scheduled payment. The message will send regardless of
                how far in the future

                the next upcoming payment date is.


                *WARNING:* Minimal sanity-checking is performed on which
                borrower-loan you are targeting.

                If you select an invalid borrower-loan, e.g., a loan paid in
                full, a message

                may still be sent.
              maxLength: 150
              nullable: true
              title: 'bulkSender: autopayPaymentReminder'
              type: string
            - description: >
                Running a campaign with a bulk sender subject of
                `loginFirstPaymentReminder`:


                These messages are intended to remind borrowers of their first

                upcoming payment if they have not yet logged into the borrower

                portal.


                ## Query Result Formatting

                The Redash query results should look like:


                ```

                borrowerId,loanId

                100,200,

                103,205,

                ...

                ```


                > Note that it is valid to use either public IDs (like
                `BO-XXXX-XXXX`) or internal

                database IDs (integers).


                ## Calculated Context Variables


                No context variables are automatically calculated.


                ## Targeting

                You MUST provide any target borrower-loans.


                *WARNING:* Minimal sanity-checking is performed on which
                borrower-loan you are targeting.

                If you select an invalid borrower-loan, e.g., a loan with
                payments already made, a message

                may still be sent.
              maxLength: 150
              nullable: true
              title: 'bulkSender: loginFirstPaymentReminder'
              type: string
            - description: >
                Running a campaign with a bulk sender subject of
                `autopayEnableReminder`:


                These messages remind borrowers to enable autopay.


                ## Query Result Formatting

                The Redash query results should look like:


                ```

                borrowerId,loanId

                100,200,

                103,205,

                ...

                ```


                > Note that it is valid to use either public IDs (like
                `BO-XXXX-XXXX`) or internal

                database IDs (integers).


                ## Calculated Context Variables


                No context variables are automatically calculated.


                ## Targeting

                You MUST provide any target borrower-loans.


                *WARNING:* No sanity-checking is performed on which
                borrower-loan you are targeting.

                If you select a borrower that has already enabled autopay, they
                will still receive

                a message here.
              maxLength: 150
              nullable: true
              title: 'bulkSender: autopayEnableReminder'
              type: string
            - description: >
                Running a campaign with a bulk sender subject of
                `autopayAmountChanged`:


                These messages inform borrowers that the amount of their

                *next* autopayment has increased.


                ## Query Result Formatting

                The Redash query results should look like:


                ```

                borrowerId,loanId

                100,200,

                103,205,

                ...

                ```


                > Note that it is valid to use either public IDs (like
                `BO-XXXX-XXXX`) or internal

                database IDs (integers).


                ## Calculated Context Variables


                The following context variables are automatically calculated and
                passed to the

                `context` field of `/communcator/send`: `extraCharge`,
                `paymentDueDate`, `paymentAmount`.


                ## Targeting

                You MUST provide any target borrower-loans.


                Loans will be skipped if they do not have an upcoming autopay or
                it is detected

                that `extraCharge == 0`.
              maxLength: 150
              nullable: true
              title: 'bulkSender: autopayAmountChanged'
              type: string
            - description: >
                Running a campaign with a bulk sender subject of
                `futurepayPaymentDueReminder`:


                These messages inform borrowers that there is an upcoming

                future payment scheduled. (Note that "autopay" is a separate
                concept from

                scheduled future payment. e.g., a borrower can schedule a single
                future payment

                instead of enabling autopay.)


                ## Query Result Formatting

                The Redash query results should look like (targetPaymentDate is
                optional):


                ```

                borrowerId,loanId,targetPaymentDate

                100,200,2023-01-01,

                103,205,,

                ...

                ```


                > Note that it is valid to use either public IDs (like
                `BO-XXXX-XXXX`) or internal

                > database IDs (integers).

                > Note that `targetPaymentDate` is optional and if it is `null`
                or not included

                > then the message will be sent for only the *next* upcoming
                scheduled payment.


                ## Calculated Context Variables


                The following context variables are automatically calculated and
                passed to the

                `context` field of `/communcator/send`: `paymentDate`,
                `paymentAmount`, `overdueAmount`


                ## Targeting

                You MUST provide any target borrower-loans.


                Loans will be skipped if they do not have an scheduled future
                payment.
              maxLength: 150
              nullable: true
              title: 'bulkSender: futurepayPaymentDueReminder'
              type: string
            - description: >
                Running a campaign with a bulk sender subject of
                `loanRightToCurePersonalUnsecured`:


                These messages inform borrowers that their loan is overdue and
                they need to

                take action to prevent charge-off.


                ## Query Result Formatting

                The Redash query results should look like:


                ```

                borrowerId,loanId

                100,200,

                103,205,

                ...

                ```


                > Note that it is valid to use either public IDs (like
                `BO-XXXX-XXXX`) or internal

                > database IDs (integers).


                ## Calculated Context Variables


                The following context variables are automatically calculated and
                passed to the

                `context` field of `/communcator/send`:
                `chargeOffDate`,`daysOverdue`,`daysToChargeOff`,`overdueBalance`.


                ## Targeting

                You MUST provide any target borrower-loans.


                Loans will be skipped if it is not overdue. Loans will be
                skipped if they are already

                in a `chargedOff` state.
              maxLength: 150
              nullable: true
              title: 'bulkSender: loanRightToCurePersonalUnsecured'
              type: string
            - description: >
                Running a campaign with a bulk sender subject of
                `cardExpiresReminder`:


                These messages inform borrowers that their payment card will
                expire.


                ## Query Result Formatting

                The Redash query results should look like (lastFour is
                optional):


                ```

                borrowerId,loanId,lastFour

                100,200,1234

                103,205,5678

                ...

                ```


                > Note that it is valid to use either public IDs (like
                `BO-XXXX-XXXX`) or internal

                > database IDs (integers).

                > Note that `lastFour` is an optional column


                ## Calculated Context Variables


                The following context variables are automatically calculated and
                passed to the

                `context` field of `/communcator/send`: `month`, `year`.


                ## Targeting

                You MUST provide any target borrower-loans.


                Loans will be skipped if there are no cards associated with the
                loan which are

                expiring *in the future*. If there are multiple cards associated
                with a loan expiring,

                then the *next* expiring card is selected.


                You MAY optionally provide a `lastFour` column in your query
                results, in which

                case a card's last four digits must match that, or the loan will
                be skipped.
              maxLength: 150
              nullable: true
              title: 'bulkSender: cardExpiresReminder'
              type: string
        schedule:
          description: |
            The schedule to run a campaign on, given in Peachy crontab time
            specification format.

            Peachy crontab is an extension to crontab(5) that adds a
            time specification value 'P', which means "Peach
            decides". Currently, the minute and hour fields must be 'P' (i.e.,
            you can not specify the time of the day), and the
            day-of-month, month, and day-of-week fields must NOT be 'P'.

            Some examples of Peachy crontabs:
              `P P 1,15 * *`: Run on the 1st and 15th of every month
              `P P * * wed`: Run every Wednesday
              `P P * 10 *`: Run every day in October

            See https://crontab.guru/ for an expression builder.

            If `null` the campaign does not run on a schedule (and therefore
            must be run manually).
          nullable: true
          type: string
        sftpSettings:
          description: >
            The SFTP settings to be used to upload the results of a campaign
            run.


            At the completion of a campaign run, if these settings are
            specified, they

            are used to SFTP upload the files created as a result of the run.


            These files include the exporter contacts .csv file and the log
            file.


            The file names for these files will be:

            - `{CAMPAIGN_ID}_{TIMESTAMP}_query_results.csv`

            - `{CAMPAIGN_ID}_{EXPORTER_ID}_{TIMESTAMP}.csv`

            - `{CAMPAIGN_ID}_{EXPORTER_ID}_{TIMESTAMP}.csv`

            - `{CAMPAIGN_ID}_{EXPORTER_ID}_{TIMESTAMP}_log.txt`
          nullable: true
          properties:
            cdDir:
              description: >
                The directory to change to (via `cd`) on the server before
                performing the

                file upload.
              type: string
            host:
              description: |
                Host of the SFTP server with which to connect.

                This may be specified like `{hostname}` or `{hostname}:{port}`.

                If no port is specified the default SFTP port of 22 is assumed.
              example: sftp.acme.com:23
              type: string
            password:
              description: >
                Note: the password field is encrypted-at-rest using the secure
                tokenizer.
              type: string
            username:
              type: string
          type: object
      type: object
    BorrowerCampaignFull:
      allOf:
        - $ref: '#/components/schemas/BaseWithExternalIdMixin'
        - $ref: '#/components/schemas/BorrowerCampaign'
    BorrowerCampaignRunStatus:
      description: The status of a campaign run
      enum:
        - failed
        - success
        - processing
        - initializing
      type: string
    BorrowerCampaignRun:
      description: >
        A borrower campaign "run" is an object representing an execution of a
        campaign.

        It contains metadata about the status of the execution of the run and
        the results

        of the run, which are generally exported contact lists and logs.
      properties:
        availableFiles:
          description: >
            The list of files currently available for download via this campaign
            run's `.../download` endpoint.
          items:
            enum:
              - query_results.csv
              - campaign_input.json
              - contacts.csv
              - log.txt
            type: string
          type: array
        borrowerCampaignId:
          description: The ID of the borrower campaign to which this campaign run belongs.
          type: string
        campaignInputFileId:
          type: string
          writeOnly: true
        contactsOutputFileId:
          type: string
          writeOnly: true
        logFileId:
          type: string
          writeOnly: true
        queryResultsFileId:
          type: string
          writeOnly: true
        status:
          $ref: '#/components/schemas/BorrowerCampaignRunStatus'
      type: object
    BaseCardIssuerPut:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            companyId:
              description: |
                The unique company identifier.
              readOnly: true
              type: string
            issuerEventsSubscriber:
              description: >
                Defines whether Peach or the lender will subscribe to the card
                issuer's events. This is usually decided based on which party
                will be involved in the authorization flow. Regardless of which
                option is selected, the lender should provide accountIdentifier
                information on the card object in order for Peach to be able to
                get information from the issuer required for servicing the loan.

                - `peach` - Peach will consume card issuer events in order to
                manage the card on behalf of the lender. Peach may provide the
                issuer information necessary to make approve/decline decisions
                as part of the auth flow, but the lender and issuer can still be
                entirely responsible for card authorization.

                - `lender` - Lender will consume issuer events and make API
                calls to Peach to ensure balances remain in sync between issuer
                and servicer. Using this option, the lender and/or issuer are
                responsible for card authorization.
              enum:
                - peach
                - lender
              type: string
            status:
              description: >
                The status of the card issuer.


                `draft` - the card issuer is in the process of being configured
                and is not yet ready to be used.


                `active` - the card issuer is ready to manage cards. Only one
                `cardIssuer` (e.g. `marqeta`) can be `active`.


                `deprecated` - the payment issuer was deprecated, and new cards
                cannot be managed.
              enum:
                - draft
                - active
                - deprecated
              type: string
            syncCardDetails:
              default: true
              description: >
                If `true`, Peach will sync the card details from the card issuer
                automatically. If `false`, the lender will update the card
                details manually.
              type: boolean
          type: object
    MarqetaCardIssuer:
      properties:
        cardIssuerType:
          description: |
            The name of the card issuer/vendor.

            `marqeta` - Peach system will use the Marqeta API to manage cards.

            `lithic` - Peach system will use the Lithic API to manage cards.

            `galileo` - Peach system will use the Galileo API to manage cards.
          enum:
            - marqeta
          type: string
        marqetaAdminAccessToken:
          description: The Marqeta admin access token.
          type: string
          writeOnly: true
        marqetaApplicationToken:
          description: The Marqeta application token.
          type: string
          writeOnly: true
        marqetaJitFundingEnabled:
          default: false
          description: >-
            If enabled, configures a JIT funding source on Marqeta and uses
            Peach for authorizations. Only applies to credit cards.
          type: boolean
        marqetaJitFundingSourceToken:
          description: The Marqeta JIT funding source token. Only applies to credit cards.
          nullable: true
          readOnly: true
          type: string
      required:
        - marqetaApplicationToken
        - marqetaAdminAccessToken
      type: object
    VirtualCardIssuerPut:
      type: object
    VirtualCardIssuer:
      allOf:
        - $ref: '#/components/schemas/VirtualCardIssuerPut'
        - properties:
            cardType:
              description: |
                The type of card issued.
              enum:
                - virtualCard
              type: string
          type: object
    MarqetaVirtualCardIssuer:
      allOf:
        - $ref: '#/components/schemas/BaseCardIssuerPut'
        - $ref: '#/components/schemas/MarqetaCardIssuer'
        - $ref: '#/components/schemas/VirtualCardIssuer'
      title: Marqeta Virtual Card
    UsageRestrictions:
      properties:
        countries:
          description: >
            The list of countries where the card cannot be used. Any attempt to
            authorize the card for a

            purchase with a country in this list will be declined.
          items:
            type: string
          type: array
        currencies:
          description: >
            The list of invalid currencies for card transactions. Any attempt to
            authorize the card for a

            purchase made in a currency in this list will be declined.
          items:
            type: string
          type: array
        merchantCategoryCodes:
          description: >
            The list of merchant category codes to restrict. Any attempt to
            authorize the card for a purchase

            with a merchant category code in the list will be declined.
          items:
            type: string
          type: array
        merchantIds:
          description: >
            The list of specific merchant ID's where the card cannot be used.
            Any attempt to authorize

            the card for a purchase with a merchant ID in the list will be
            declined.
          items:
            type: string
          type: array
        merchantNamesRegex:
          description: >
            The list of merchant names where the card cannot be used. The format
            is a regular expression.

            Please contact the Peach team to see examples of the merchant names.

            Peach will use matching logic using the regex value to decline
            transactions for merchants included in this list.

            Lenders need to carefully assess this restriction because of the
            challenge in matching names in this

            list to the merchant names provided during authorization.
          items:
            type: string
          type: array
      type: object
    CreditCardIssuerPut:
      properties:
        program:
          properties:
            auth:
              properties:
                authLogic:
                  description: Only applicable if `authManagedBy = peach`
                  properties:
                    authCustomFunctionId:
                      description: >
                        The identifier of the authorization code referenced for
                        executing auth logic. This is a custom function. Please
                        coordinate with Peach before passing a value.

                        Only applicable if `authLogic = custom`
                      type: string
                    authThresholdAmount:
                      description: >
                        The amount over which the `creditLimit` may be exceeded.
                        If provided, the system will approve a purchase that
                        exceeds the `creditLimit` by `authThresholdAmount`
                        amount. Keep in mind that Draw can have a credit limit
                        (it's optional as Line of Credit always has a credit
                        limit). If a draw has a credit limit, this threshold
                        will be also checked on the draw level. Keep empty/null
                        if not applicable.


                        For example:

                        - Credit limit is $1000.00.

                        - Current utilization is $980.00.

                        - `authThresholdAmount` is $20.00.

                        - Purchase of $33.00 will be approved. $980.00 + $33.00
                        < $1000.00 + $20.00.


                        Both `authThresholdAmount` and `authThresholdPercentage`
                        values can be provided.
                      type: integer
                    authThresholdPercentage:
                      description: >
                        The percentage over which the `creditLimit` may be
                        exceeded. If provided, the system will approve a
                        purchase that exceeds the `creditLimit` by
                        `authThresholdPercentage` percentage. Keep in mind that
                        Draw can have a credit limit (it's optional as Line of
                        Credit always has a credit limit). If a draw has a
                        credit limit, this threshold will be also checked on the
                        draw level. Keep empty/null if not applicable.

                        The format is decimal. For example, 0.01 is 1% and 0.15
                        is 15%.


                        For example:

                        - Credit limit is $1000.00.

                        - Current utilization is $980.00.

                        - `authThresholdPercentage` is 0.05 (aka 5.00%).

                        - Purchase of $33.00 will be approved. $980.00 + $33.00
                        < $1000.00 * (1 + 0.05).


                        Both `authThresholdAmount` and `authThresholdPercentage`
                        values can be provided.
                      format: float
                      type: number
                  type: object
                authManagedBy:
                  default: lender
                  description: >
                    Indicates who is responsible for purchase authorization
                    logic.
                  enum:
                    - lender
                    - peach
                  type: string
              type: object
            drawMappingEnabled:
              description: >
                Enables lenders to allow Peach to automatically associate
                purchases with specific draws based on the `drawType` selected

                during draw creation.


                For example, if `drawMappingEnabled` is `true`, Peach is
                receiving card issuer events, and a draw is created with

                `drawType="cashAdvance"`, Peach will automatically associate
                specific transaction types with the `cashAdvance` draw based

                on internal mapping logic.


                If `drawMappingEnabled` is `false` and there is more than one
                draw on the card credit product, Peach's system will add

                the purchase to an arbitrarily chosen draw.
              nullable: true
              type: boolean
            usageRestrictions:
              allOf:
                - description: >
                    Details on restrictions applied to the card product. Leaving
                    the attributes blank indicates that the card can be used in
                    any capacity. Including data for any of the attributes
                    indicates that card usage should be restricted and NOT used
                    in that capacity. E.g. currencies = USD means that purchases
                    may NOT be made using USD currency.
                - $ref: '#/components/schemas/UsageRestrictions'
          type: object
      type: object
    CreditCardIssuer:
      allOf:
        - properties:
            cardType:
              description: |
                The type of card issued.
              enum:
                - creditCard
              type: string
          type: object
        - $ref: '#/components/schemas/CreditCardIssuerPut'
    MarqetaCreditCardIssuer:
      allOf:
        - $ref: '#/components/schemas/BaseCardIssuerPut'
        - $ref: '#/components/schemas/MarqetaCardIssuer'
        - $ref: '#/components/schemas/CreditCardIssuer'
      title: Marqeta Credit Card
    LithicCardIssuer:
      properties:
        cardIssuerType:
          description: |
            The name of the card issuer/vendor.

            `marqeta` - Peach system will use the Marqeta API to manage cards.

            `lithic` - Peach system will use the Lithic API to manage cards.

            `galileo` - Peach system will use the Galileo API to manage cards.
          enum:
            - lithic
          type: string
        lithicApiKey:
          description: The Lithic API key.
          type: string
          writeOnly: true
        lithicAsaWebhookSecret:
          description: The Lithic ASA webhook secret.
          type: string
          writeOnly: true
        lithicEventsWebhookSecret:
          description: The Lithic events webhook secret.
          type: string
          writeOnly: true
      required:
        - lithicApiKey
      type: object
    LithicCreditCardIssuer:
      allOf:
        - $ref: '#/components/schemas/BaseCardIssuerPut'
        - $ref: '#/components/schemas/LithicCardIssuer'
        - $ref: '#/components/schemas/CreditCardIssuer'
      title: Lithic Credit Card
    GalileoCardIssuer:
      properties:
        cardIssuerType:
          description: |
            The name of the card issuer/vendor.

            `marqeta` - Peach system will use the Marqeta API to manage cards.

            `lithic` - Peach system will use the Lithic API to manage cards.

            `galileo` - Peach system will use the Galileo API to manage cards.
          enum:
            - galileo
          type: string
        galileoApiLogin:
          description: The Galileo API login.
          type: string
          writeOnly: true
        galileoApiTransKey:
          description: The Galileo API key.
          type: string
          writeOnly: true
        galileoBaseUrl:
          description: The Galileo base URL.
          type: string
        galileoProviderId:
          description: The Galileo provider ID.
          type: string
      required:
        - galileoApiLogin
        - galileoApiTransKey
        - galileoProviderId
        - galileoBaseUrl
      type: object
    GalileoVirtualCardIssuer:
      allOf:
        - $ref: '#/components/schemas/BaseCardIssuerPut'
        - $ref: '#/components/schemas/GalileoCardIssuer'
        - $ref: '#/components/schemas/VirtualCardIssuer'
      title: Galileo Virtual Card
    GalileoCreditCardIssuer:
      allOf:
        - $ref: '#/components/schemas/BaseCardIssuerPut'
        - $ref: '#/components/schemas/GalileoCardIssuer'
        - $ref: '#/components/schemas/CreditCardIssuer'
      title: Galileo Credit Card
    QoloCardIssuer:
      properties:
        cardIssuerType:
          description: |
            The name of the card issuer/vendor.

            `marqeta` - Peach system will use the Marqeta API to manage cards.

            `lithic` - Peach system will use the Lithic API to manage cards.

            `galileo` - Peach system will use the Galileo API to manage cards.

            `qolo` - Peach system will use the Qolo API to manage cards.
          enum:
            - qolo
          type: string
        qoloApiKey:
          description: The Qolo API Key.
          type: string
          writeOnly: true
        qoloLoginId:
          description: The Qolo login ID.
          type: string
          writeOnly: true
      required:
        - qoloLoginId
        - qoloApiKey
      type: object
    QoloCreditCardIssuer:
      allOf:
        - $ref: '#/components/schemas/BaseCardIssuerPut'
        - $ref: '#/components/schemas/QoloCardIssuer'
        - $ref: '#/components/schemas/CreditCardIssuer'
      title: Qolo Credit Card
    CardIssuer:
      anyOf:
        - $ref: '#/components/schemas/MarqetaVirtualCardIssuer'
        - $ref: '#/components/schemas/MarqetaCreditCardIssuer'
        - $ref: '#/components/schemas/LithicCreditCardIssuer'
        - $ref: '#/components/schemas/GalileoVirtualCardIssuer'
        - $ref: '#/components/schemas/GalileoCreditCardIssuer'
        - $ref: '#/components/schemas/QoloCreditCardIssuer'
    MarqetaCardIssuerPut:
      properties:
        cardIssuerType:
          description: |
            The name of the card issuer/vendor.

            `marqeta` - Peach system will use the Marqeta API to manage cards.

            `lithic` - Peach system will use the Lithic API to manage cards.

            `galileo` - Peach system will use the Galileo API to manage cards.
          enum:
            - marqeta
          readOnly: true
          type: string
        marqetaApplicationToken:
          description: The Marqeta application token.
          type: string
          writeOnly: true
        marqetaJitFundingEnabled:
          default: false
          description: >-
            If enabled, configures a JIT funding source on Marqeta and uses
            Peach for authorizations.
          type: boolean
      type: object
    MarqetaVirtualCardIssuerPut:
      allOf:
        - $ref: '#/components/schemas/BaseCardIssuerPut'
        - $ref: '#/components/schemas/MarqetaCardIssuerPut'
        - $ref: '#/components/schemas/VirtualCardIssuerPut'
      title: Marqeta Virtual Card
    MarqetaCreditCardIssuerPut:
      allOf:
        - $ref: '#/components/schemas/BaseCardIssuerPut'
        - $ref: '#/components/schemas/MarqetaCardIssuerPut'
        - $ref: '#/components/schemas/CreditCardIssuerPut'
      title: Marqeta Credit Card
    LithicCardIssuerPut:
      properties:
        lithicApiKey:
          description: The Lithic API key.
          type: string
          writeOnly: true
        lithicAsaWebhookSecret:
          description: The Lithic ASA webhook secret.
          type: string
          writeOnly: true
        lithicEventsWebhookSecret:
          description: The Lithic events webhook secret.
          type: string
          writeOnly: true
      type: object
    LithicCreditCardIssuerPut:
      allOf:
        - $ref: '#/components/schemas/BaseCardIssuerPut'
        - $ref: '#/components/schemas/LithicCardIssuerPut'
        - $ref: '#/components/schemas/CreditCardIssuerPut'
      title: Lithic Credit Card
    GalileoCardIssuerPut:
      properties:
        galileoApiLogin:
          description: The Galileo API login.
          type: string
          writeOnly: true
        galileoApiTransKey:
          description: The Galileo API key.
          type: string
          writeOnly: true
        galileoBaseUrl:
          description: The Galileo base URL.
          type: string
        galileoProviderId:
          description: The Galileo provider ID.
          type: string
      type: object
    GalileoVirtualCardIssuerPut:
      allOf:
        - $ref: '#/components/schemas/BaseCardIssuerPut'
        - $ref: '#/components/schemas/GalileoCardIssuerPut'
        - $ref: '#/components/schemas/VirtualCardIssuerPut'
      title: Galileo Virtual Card
    GalileoCreditCardIssuerPut:
      allOf:
        - $ref: '#/components/schemas/BaseCardIssuerPut'
        - $ref: '#/components/schemas/GalileoCardIssuerPut'
        - $ref: '#/components/schemas/CreditCardIssuerPut'
      title: Galileo Credit Card
    QoloCardIssuerPut:
      properties:
        qoloApiKey:
          description: The Qolo API Key.
          type: string
          writeOnly: true
        qoloLoginId:
          description: The Qolo login ID.
          type: string
          writeOnly: true
      type: object
    QoloCreditCardIssuerPut:
      allOf:
        - $ref: '#/components/schemas/BaseCardIssuerPut'
        - $ref: '#/components/schemas/QoloCardIssuerPut'
        - $ref: '#/components/schemas/CreditCardIssuerPut'
      title: Qolo Credit Card
    CardIssuerPut:
      anyOf:
        - $ref: '#/components/schemas/MarqetaVirtualCardIssuerPut'
        - $ref: '#/components/schemas/MarqetaCreditCardIssuerPut'
        - $ref: '#/components/schemas/LithicCreditCardIssuerPut'
        - $ref: '#/components/schemas/GalileoVirtualCardIssuerPut'
        - $ref: '#/components/schemas/GalileoCreditCardIssuerPut'
        - $ref: '#/components/schemas/QoloCreditCardIssuerPut'
    VersionedMixin:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            companyId:
              description: |
                The company identifier of the type.
              readOnly: true
              type: string
            createdBy:
              nullable: true
              readOnly: true
              type: integer
            deprecatedAt:
              format: date-time
              nullable: true
              readOnly: true
              type: string
            deprecatedBy:
              nullable: true
              readOnly: true
              type: integer
            deprecationMessage:
              maxLength: 100
              nullable: true
              readOnly: true
              type: string
            derivedFromTypeId:
              default: '0'
              description: |
                The type identifier that this type was derived from.
              readOnly: true
              type: string
            description:
              default: ''
              description: >
                The description for instances of that type. The description
                could be shown in UI.
              maxLength: 500
              type: string
            name:
              default: ''
              description: >
                The default name for instances of that type. The name could be
                shown in UI.
              maxLength: 50
              type: string
            publishedAt:
              format: date-time
              nullable: true
              readOnly: true
              type: string
            publishedBy:
              nullable: true
              readOnly: true
              type: integer
            status:
              default: draft
              description: >
                The type status. A new type is normally created in the `draft`
                status. After you finish

                with the type configurations and ready to create instances of
                that type, update the status to `active`.


                You can also update an existing type. Each update will create a
                new version of the type.

                Only one version of the type can be `active`. We'll
                automatically change the previous version to `deprecated`.

                Instances in-flight will continue to use the previous
                version(s).

                New instances will be created using the `active` version.
              enum:
                - draft
                - active
                - deprecated
              type: string
            version:
              default: 1
              description: |
                The type version.
              readOnly: true
              type: integer
          type: object
    CaseTypeAssociation:
      description: |
        Objects are related to `CaseType`, and may have an optional label.
      properties:
        objectId:
          description: Peach unique identifier for the associated object.
          type: integer
        objectType:
          description: Types of objects that can be associated with the case.
          enum:
            - doNotInteractType
            - notificationType
            - loanType
          type: string
      title: objectAssociation
      type: object
    DataType:
      description: The field type of data. Used for properly parsing the field value.
      enum:
        - integer
        - real
        - string
        - boolean
        - dateTime
      type: string
    FieldName:
      description: |
        Name of the field as known in the API (e.g. `typeId` not `type_id`).
      type: string
    CustomFieldSchema:
      properties:
        dataType:
          $ref: '#/components/schemas/DataType'
        default:
          anyOf:
            - nullable: true
              type: number
            - nullable: true
              type: string
            - nullable: true
              type: boolean
          description: The default value of the field.
        description:
          default: ''
          description: >-
            A helpful description of what the field is and does. Displayed in
            UI.
          maxLength: 500
          type: string
        displayOrder:
          description: >-
            Desired order of the field appearance in UI. Use whole numbers. For
            example, `3` will be placed after `1`.
          nullable: true
          type: integer
        displayPostfix:
          description: >
            A postfix to display after the field value. For example, a field
            `amount` can have a postfix `USD` to display `100 USD`.
          nullable: true
          type: string
        displayPrefix:
          description: >
            A prefix to display before the field value. For example, a field
            `amount` can have a prefix `$` to display `$100`.
          nullable: true
          type: string
        fieldName:
          $ref: '#/components/schemas/FieldName'
        name:
          default: ''
          description: Field name as displayed in UI.
          maxLength: 50
          type: string
        required:
          default: false
          description: Indicates whether this field is required on a new case creation.
          type: boolean
        validation:
          description: Validation rules
          properties:
            enum:
              description: >-
                The list of valid values. Applicable to `dataType=string`,
                `integer` and `real`.
              example:
                - 1
                - 10
                - 100
              items:
                oneOf:
                  - type: string
                  - type: number
              type: array
            length:
              description: >-
                The length of the field if applicable. For example, `string` can
                be limited to 50 characters.
              minimum: 1
              nullable: true
              type: integer
            maxValue:
              description: The maximum value. Applicable to `dataType=integer` and `real`.
              example: 100
              type: number
            minValue:
              description: The minimum value. Applicable to `dataType=integer` and `real`.
              example: 0
              type: number
          type: object
      required:
        - name
        - fieldName
        - dataType
      title: customFieldSchema
      type: object
    CaseType:
      allOf:
        - $ref: '#/components/schemas/VersionedMixin'
        - properties:
            associations:
              description: Associated objects to the case.
              items:
                $ref: '#/components/schemas/CaseTypeAssociation'
              readOnly: true
              type: array
            customFieldSchemas:
              description: |
                Array of custom fields definitions.
              items:
                $ref: '#/components/schemas/CustomFieldSchema'
              nullable: true
              type: array
            loanTypeId:
              description: >
                The optional identifier of a loan type. This is useful when a

                lender has two or more financial products and need different
                case types per product.
              type: string
            object:
              default: caseType
              enum:
                - caseType
              readOnly: true
              type: string
            smartReviews:
              properties:
                config:
                  description: >
                    Configuration fields for when to create reminder

                    tasks. Varies per case-type. See <a

                    href="/api-docs/api-public/smart-reviews">Smart Reviews</a>
                    for more

                    in-depth documentation.
                  nullable: true
                  type: object
                enable:
                  description: >
                    Enable or disable using these settings to create reminder
                    tasks.
                  type: boolean
              type: object
            workflowTypeId:
              description: >
                The optional identifier of a workflow type. Instances of the
                workflow

                type are created for processing cases of this type.
              type: string
          type: object
      title: caseType
    BaseCaseType:
      enum:
        - generic
        - bankruptcy
        - ceaseCommunication
        - collection
        - deceased
        - disputeOfDebt
        - federalEmergency
        - identityTheft
        - legalAction
        - militaryDuty
        - debtValidation
        - oFACSanctionedIndividual
        - disputeOfPurchase
        - creditBureauDispute
      type: string
    CaseTypePostOnly:
      allOf:
        - properties:
            caseType:
              $ref: '#/components/schemas/BaseCaseType'
              description: >
                The base case type for your case. If you choose any special
                type, except for `generic`, your case

                type will inherit all the attributes of that special type.
            copyOf:
              description: |
                The ID of case type to copy and advance the version number
              type: integer
          type: object
        - $ref: '#/components/schemas/CaseType'
      title: caseType
    InteractionStatus:
      description: >
        The status of an interaction.


        `status` is important, as it can impact future interactions.

        For instance, in jurisdictions which cap the number

        of outbound collection communications to a borrower,

        `status=failed` interactions do not count against the legal allotment.


        Interaction `status` can be updated as the interaction status changes.

        For example, when an email is sent, set the status to `attempted`. If

        the email is opened, set the status to `succeeded`. If the email
        bounces,

        set the status to `failed`. `attempted` is assumed to be a successful

        interaction. Optionally, you can also use 'statusDetails' to provide

        additional details about status.


        ## In-Progress interactions


        Some interactions—like an email—take place at a single point in time,
        others

        might be ongoing for many minutes—like a phone call.


        Ongoing interactions like voice and chat may have their status set to
        `inProgress`.


        ## Scheduled interactions


        Some interactions might be scheduled for the future. These interactions

        have a status of `scheduled`. If this scheduled interaction is
        unscheduled

        then it has a status of `canceled`.


        ## Null


        Note that `null` is not a valid status name but rather can be used to
        specify a

        query for interactions with a `status` of `null`
      enum:
        - attempted
        - succeeded
        - failed
        - scheduled
        - canceled
        - inProgress
        - 'null'
      type: string
    InteractionChannel:
      description: |
        The channel where interactions with a borrower occur. For example, an
        outbound call with a borrower is considered a `voice` interaction.

        **DEPRECATED**: The `fax` channel is deprecated: new interactions
        cannot be created with the `fax` channel. It will be removed
        from completely in the future.
      enum:
        - voice
        - email
        - fax
        - text
        - chat
        - mail
        - gui
        - document
      nullable: true
      type: string
    ObjectAssociation:
      description: |
        Objects are related to case.
      properties:
        objectId:
          description: Peach unique identifier for the associated object.
          type: string
        objectType:
          description: Types of objects that can be associated with the case.
          enum:
            - document
            - interaction
            - loan
            - case
            - transaction
          type: string
      title: objectAssociation
      type: object
    CaseAssociation:
      allOf:
        - $ref: '#/components/schemas/ObjectAssociation'
        - properties:
            relation:
              default: related
              description: >
                This is only applicable to `objectType=case` associations.


                The way to read the relation is: `caseId` `relation` `objectId`.

                For example:


                - There is an existing `caseId=111` `caseType=identityTheft`.

                - There is an existing `caseId=222` `caseType=debtValidation`.

                - The identity theft case is blocking verification of debt. To
                represent that relation:

                - `caseId=111` in path parameter.

                - `relation=blocks` in body.

                - `objectId=222` in body.
              enum:
                - related
                - causes
                - blocks
                - duplicate
              type: string
          type: object
      description: |
        Objects are related to case, and may have an optional label.
      title: caseAssociation
    CaseConfigType:
      description: >
        Summary information about the case type configuration which produced the
        case.
      properties:
        base:
          type: string
        derivedFromTypeId:
          nullable: true
          type: string
        id:
          type: string
        name:
          type: string
        version:
          type: integer
      readOnly: true
      title: caseConfigType
      type: object
    UserActionInfo:
      nullable: true
      properties:
        descriptor:
          description: >
            Short description of the user who performed the action.

            Different systems may have different data available for a given
            user. The descriptor

            gives the best available short description of the user. It prefers
            names, then email addresses,

            then related IDs.


            e.g.,

            - "Borrower Tim Jones"

            - "Borrower BO-ABCD-1234"

            - "Peach Service User"

            - "Agent Abigail Smith"

            - "Agent bob@acme.com"

            - "Agent EM-ABCD-1234"
          example: Agent bob@acme.com
          nullable: true
          type: string
        employee:
          nullable: true
          properties:
            id:
              description: The employee's ID
              type: string
          type: object
        id:
          description: The unique identifier of the user who performed the action.
          type: string
        name:
          description: The name of the user who performed the action.
          nullable: true
          type: string
        userType:
          $ref: '#/components/schemas/UserType'
      readOnly: true
      type: object
    CaseCreationProcedure:
      description: |
        The field indicating which procedure originally created this case.

        This is used to mark when a system like, for instance, Compliance Guard 
        automatically created a case, which allows a case to be 
        differentiated from, for instance, manually created ones.
      enum:
        - automatedCollectionsDetection
        - automatedOfacDetection
        - automatedBankruptcyDetection
        - automatedDeceasedDetection
        - automatedScraDetection
        - supercasePopulationCommit
      nullable: true
      type: string
    CustomFields:
      additionalProperties: true
      description: >
        Custom fields are JSON key-value mappings. They are described by a
        `customFieldSchemas` property in the corresponding

        `caseType`. This means that arbitrary fields cannot be added to
        in-flight cases.
      nullable: true
      title: customFields
      type: object
    MatchDetails:
      description: >
        The fields that are for what levels the person is matched to a
        monitoring hit (i.e. bankruptcy)
      properties:
        addressMatch:
          enum:
            - match
            - partialMatch
            - noMatch
            - notApplicable
          type: string
        dateOfBirthMatch:
          enum:
            - match
            - partialMatch
            - noMatch
            - notApplicable
          type: string
        externalMatchCode:
          nullable: true
          type: string
        last4SSNMatch:
          enum:
            - match
            - partialMatch
            - noMatch
            - notApplicable
          type: string
        matchDoneBy:
          enum:
            - dataVendor
            - peach
          type: string
        nameMatch:
          enum:
            - match
            - partialMatch
            - noMatch
            - notApplicable
          type: string
        ssnMatch:
          enum:
            - match
            - partialMatch
            - noMatch
            - notApplicable
          type: string
      title: matchDetails
      type: object
    MetaData:
      description: Store any type of key/value pairs in the form of a JSON dictionary.
      nullable: true
      type: object
    ProcessOutcome:
      description: >
        The outcome of a process, case, complaint, or dispute.

        - If found to be valid, set value to `approved`.

        This might impact debt collection efforts.

        - If dismissed, set value to `denied`.

        This will have no further impact on debt collection efforts.

        - If found to be a false positive, set value to `falsePositive`.

        - If completed without an outcome (or no outcome was needed), set to
        `noOutcome`.
      enum:
        - approved
        - denied
        - falsePositive
        - noOutcome
      nullable: true
      title: outcome
      type: string
    ProcessStatus:
      description: >
        The status of a process. This can be updated by a lender or by Peach.


        `initiated` - The lender was notified by a borrower, but no documents or

        evidence have been provided yet. A grace period can be set.


        `processing` - Peach matched the borrower to an external data source, or
        the

        lender started an internal process to handle a case, complaint or
        dispute.


        `completed` - The lender completed an internal process, case, complaint
        or

        dispute. For example:

        - A borrower reported identity theft, and the lender reviewed documents

        and approved the claim.

        - A borrower requested a verification of debt in writing, and the lender
        sent an email with

        details.

        - Peach notified the lender about a new bankruptcy, and the lender
        reviewed

        the case and deemed it to be a false positive.


        `canceled` - The lender couldn't complete an internal process and
        canceled

        it. This can happen for various reasons, such as lack of

        sufficient documentation.


        `reopened` - The lender re-opened the case.
      enum:
        - initiated
        - processing
        - completed
        - canceled
        - reopened
      title: status
      type: string
    CaseAttributes:
      properties:
        associations:
          description: Associated objects of the case.
          items:
            anyOf:
              - $ref: '#/components/schemas/ObjectAssociation'
              - $ref: '#/components/schemas/CaseAssociation'
          nullable: true
          type: array
        autoCreated:
          description: >
            True if the case was created by some automated method—i.e., not by a
            human.
          type: boolean
        borrowerIds:
          description: List of borrower IDs associated with case
          items:
            type: string
          type: array
        caseTypeMeta:
          $ref: '#/components/schemas/CaseConfigType'
        companyId:
          description: The company's ID
          readOnly: true
          type: string
        createReviewTask:
          description: >
            If `true` create a task of type `reviewAutoCreatedCase`. Note: this
            field is NOT saved

            on the case resource; it just creates a task.
          type: boolean
          writeOnly: true
        createdByUser:
          $ref: '#/components/schemas/UserActionInfo'
          description: |
            Details of the user responsible for creating the case.
            Can be an agent or automated system process.
        creatingSupercaseId:
          description: The ID of the supercase if the case was created by one.
          nullable: true
          readOnly: true
          type: string
        creationProcedure:
          $ref: '#/components/schemas/CaseCreationProcedure'
        customFields:
          $ref: '#/components/schemas/CustomFields'
        escalatedAt:
          description: |
            Timestamp of when the case was escalated.
          format: date-time
          nullable: true
          type: string
        escalatedEmployeeId:
          description: The ID of the Employee to which the case should be escalated.
          nullable: true
          type: string
        escalatedTeamId:
          description: The ID of the Team to which the case should be escalated.
          nullable: true
          type: string
        escalationIsUrgent:
          description: |
            Boolean representing if this escalation is urgent. `null` if there
            is no escalation.
          nullable: true
          type: boolean
        externalId:
          $ref: '#/components/schemas/externalId'
        lastSubresourceUpdatedAt:
          description: >
            The date-time at which the case or it's subresources were last
            updated.


            A case or case's subresources are considered updated when:


            - an attribute of a Case is changed directly—e.g., it's name.

            - a Snooze, Do Not Interact, Document Upload Link, or Note is
            created, deleted or updated.

            - an Interaction, Document, Loan, or Transaction is associated or
              unassociated with the case.
          format: date-time
          nullable: true
          readOnly: true
          type: string
        lastSubresourceUpdatedBy:
          $ref: '#/components/schemas/UserActionInfo'
          description: >
            Details of the user responsible for last updating a case or a case's
            subresources.

            Can be an agent or automated system process. 


            See `lastSubresourceUpdatedAt` for a description of subresources.
        lastViewedAt:
          description: |
            The date-time at which the case was last viewed. 

            i.e., when this case last had this request made:
            `POST /api/people/{borrowerId}/cases/{caseId}/views`
          format: date-time
          nullable: true
          readOnly: true
          type: string
        lastViewedBy:
          $ref: '#/components/schemas/UserActionInfo'
          description: |
            Details of the user responsible for last viewing the case.

            i.e., the user which last made the request:
            `POST /api/people/{borrowerId}/cases/{caseId}/views`
        lenderAck:
          default: false
          description: |
            The lender has acknowledged the auto-generated case.
          nullable: true
          type: boolean
        matchDetails:
          $ref: '#/components/schemas/MatchDetails'
        matchToDataSource:
          description: >
            `true` if the person's details have been matched to an external data
            source.
          nullable: true
          type: boolean
        metaData:
          $ref: '#/components/schemas/MetaData'
        name:
          description: >
            The case name. If a name is not provided, the case name is taken
            from the case type.

            For example, Identity Theft.
          maxLength: 100
          minLength: 1
          type: string
        object:
          default: case
          enum:
            - case
          readOnly: true
          type: string
        openedAt:
          description: >
            Represents the original date-time a case was created, either within 

            Peach or in an external system. For cases created directly in Peach
            CRM, `openedAt` is identical to `createdAt`,

            marking the initiation within Peach. Conversely, for cases migrated
            from external sources, `openedAt` reflects 

            the time the case was originally established in the external system.
            The timestamp must include a timezone (or UTC offset).
          format: date-time
          nullable: true
          type: string
        outcome:
          $ref: '#/components/schemas/ProcessOutcome'
        outcomeUpdatedAt:
          description: |
            Timestamp of last outcome update.
          format: date-time
          nullable: true
          readOnly: true
          type: string
        outcomeUpdatedBy:
          $ref: '#/components/schemas/UserActionInfo'
          description: |
            Details of the user responsible for last updating the case outcome.
            Can be an agent or automated system process.
        owningEmployee:
          description: >
            Metadata about the owning employee of the case. The owning employee
            is the

            preferred employee to process tasks relating to this case.
          nullable: true
          properties:
            displayName:
              description: >
                The display name of the employee that owns this case. The
                display name is the full name 

                of the employee or, if not available, the employee's email.
              readOnly: true
              type: string
            id:
              description: The ID of the employee that owns this case.
              readOnly: true
              type: string
            twilioWorkerSid:
              description: The Twilio worker SID of the employee that owns this case.
              readOnly: true
              type: string
          readOnly: true
          type: object
        owningEmployeeId:
          description: |
            The ID of the employee that owns this case. The case owner is the
            preferred employee to process tasks relating to this case.

            Case ownership must be enabled via setting
            `tasks.enableCaseOwnership` to `true` in the company configuration.
          nullable: true
          type: string
        people:
          description: List of borrower IDs associated with case
          items:
            type: string
          type: array
        snoozedAt:
          description: Time when the case was snoozed.
          format: date-time
          nullable: true
          readOnly: true
          type: string
        snoozedUntil:
          description: Date until the case is snoozed.
          format: date
          nullable: true
          readOnly: true
          type: string
        status:
          $ref: '#/components/schemas/ProcessStatus'
        statusUpdatedAt:
          description: |
            Timestamp of the last status update.
          format: date-time
          nullable: true
          readOnly: true
          type: string
        statusUpdatedBy:
          $ref: '#/components/schemas/UserActionInfo'
          description: |
            Details of the user responsible for last updating the case status.
            Can be an agent or automated system process.
        workflowId:
          description: The ID of the workflow instance assigned to this case.
          nullable: true
          type: string
      type: object
    Bankruptcy:
      description: Keyword parameters unique to bankruptcies.
      properties:
        anticipatedCaseCompletionDate:
          description: |
            In a bankruptcy chapter that leverages a reorganization and a new
            payment plan (i.e. Chapter 13), record when the last payment is
            expected to be received. This will trigger reminders to close out
            the case.
          format: date
          nullable: true
          type: string
        caseType:
          enum:
            - bankruptcy
          type: string
        courtCaseChapter:
          description: |
            The bankruptcy chapter code. One of four common types we support at
            this time.
          enum:
            - chapter7
            - chapter11
            - chapter12
            - chapter13
            - unknown
          type: string
        courtCaseClosedDate:
          description: >
            Date the bankruptcy case closed, and the case is no longer on the
            court docket.
          format: date
          type: string
        courtCaseDebtorDisposition:
          description: |
            The outcome of the bankruptcy case decided by the court.
          enum:
            - dismissed
            - discharged
            - reinstated
          type: string
        courtCaseDebtorDispositionDate:
          description: |
            Date on which the disposition was decided by the court.
          format: date
          type: string
        courtCaseFiledDate:
          description: |
            The bankruptcy court filing date. This is also when 'automatic stay'
            is invoked and creditors must stop calling borrowers or making
            attempts to collect on his or her debt.
          format: date
          type: string
        courtCaseLastStatus:
          description: |
            The latest-reported bankruptcy case status, not case outcome, as it
            appears in the court.
          enum:
            - filed
            - dismissed
            - discharged
            - conversion
            - reinstated
            - closedFiledInError
            - closedTransferredOut
            - closedDischargeNA
            - closedUndeterminedReason
          type: string
        courtCaseLastStatusUpdatedDate:
          description: |
            Date on which the latest status of the bankruptcy case was updated.
          format: date
          type: string
        courtCaseNumber:
          description: |
            The unique identifier the courts use during the filing and review of
            the bankruptcy.
          type: string
        creditorClaimDeadlineDate:
          description: >
            The date a lender has to file a claim to be eligible for any
            bankruptcy proceeds.
          format: date
          nullable: true
          type: string
        listedOutstandingDebt:
          description: >
            When a bankruptcy is filed, the borrower lists all the
            creditors/loans

            he/she knows to be outstanding. Sometimes he/she may forget to list

            a loan/creditor, in which case the creditor may want to file a claim

            to ensure that the loan is added to the list of accounts to include

            in the bankruptcy.
          type: boolean
      title: bankruptcy
      type: object
    CeaseCommunication:
      properties:
        caseType:
          enum:
            - ceaseCommunication
          type: string
        interactionId:
          description: ID for the interaction that resulted in the case being opened
          type: integer
        noticeReceivedDate:
          description: >
            The written notification date, or oral notice as mandated by each
            state, of the cease communications. This is when the legal timeline
            begins.
          format: date
          type: string
      title: ceaseCommunication
      type: object
    Name:
      description: Name of the person.
      nullable: true
      properties:
        createdAt:
          format: date-time
          readOnly: true
          type: string
        current:
          default: true
          description: Name is flagged as current.
          readOnly: true
          type: boolean
        deletedAt:
          format: date-time
          nullable: true
          readOnly: true
          type: string
        effectiveAt:
          format: date-time
          nullable: true
          readOnly: true
          type: string
        firstName:
          description: A person's first name.
          maxLength: 50
          type: string
        id:
          readOnly: true
          type: string
        lastName:
          description: A person's last name.
          maxLength: 50
          type: string
        maidenLastName:
          description: A person's maiden name, if applicable.
          nullable: true
          type: string
        middleName:
          description: A person's middle name.
          maxLength: 50
          nullable: true
          type: string
        object:
          default: name
          enum:
            - name
          readOnly: true
          type: string
        originalValue:
          description: The original value for name before an update.
          readOnly: true
          type: object
        preferredFirstName:
          description: >
            A person's preferred first name. This name will be used for
            interactions

            like emails, text messages, outbound calls, online portal, etc.

            If no preferred name is provided, `firstName` will be used.
          nullable: true
          type: string
        prefix:
          description: A person's name prefix.
          nullable: true
          type: string
        source:
          enum:
            - peach
            - lender
            - externalAPI
          readOnly: true
          type: string
        status:
          enum:
            - active
            - inactive
          readOnly: true
          type: string
        suffix:
          description: A person's name suffix.
          maxLength: 5
          nullable: true
          type: string
        updatedAt:
          format: date-time
          nullable: true
          readOnly: true
          type: string
      required:
        - firstName
        - lastName
      type: object
    ContactAffiliation:
      description: >

        All contacts are associated with one borrower. Sometimes the contact
        represents information

        about the borrower person themselves—e.g., the borrower's address.
        Sometimes the contact

        represents information about a person affiliated with the borrower.


        `self` - denotes contact information about the borrower. All `self`
        contacts are considered to be **first-party**.


        `spouse`, `parent`, `guardian`, `executor`, `administrator`, `legal` and
        `otherRelative` - are

        considered to be a **third-party**. Some regulations define these to be
        the **consumer** (aka the person)

        for purposes of debt collection efforts. This means that a debt
        collector may communicate about the debt

        with the consumer's spouse, parent (if the consumer is a minor),
        guardian,

        executor, or administrator (or with the attorney of any of these
        people).


        Automated text messages (e.g. payment reminder) can only be sent to
        contactType=`phone`,

        label=`personal` and affiliation=`self`.
      enum:
        - self
        - spouse
        - parent
        - guardian
        - executor
        - administrator
        - otherRelative
        - legal
        - businessOwner
        - businessExecutive
        - businessEmployee
      type: string
    ContactType:
      description: >
        The type of contact.


        `phone` and `whatsApp` should be provided in
        _[E.164](https://en.wikipedia.org/wiki/E.164)_ format.


        `email` should be provided in *aaa@bbb.com* format.


        `address` is the mailing address.


        `fbMessenger` can be phone or email.
      enum:
        - phone
        - email
        - address
        - whatsApp
        - fbMessenger
      type: string
    ContactLabel:
      description: >
        The contact label.


        A person's mobile phone should be labeled as `personal`.


        A person's home address should be labeled as `home`.


        A servicemember's military unit or commander contact should be labeled
        as `military`.


        Automated text messages (e.g. payment reminder) can only be sent to
        contactType=`phone`,

        label=`personal` and affiliation=`self`.
      enum:
        - personal
        - home
        - work
        - military
      type: string
    ContactStatus:
      description: >
        Describes the contact status as primary, secondary, additional or
        archived.

        Within a set of contacts with the same `contactType` and `affilation`

        only one `primary` and only one `secondary` contacts are allowed. There
        may

        be multiple `additional` and `archived` contacts.


        If a new contact is created as `primary` and there is an existing

        `primary` contact with the same `contactType` and `affilation`,

        the status of the existing contact will be automatically changed to

        `additional`.


        If a new contact is created as `secondary` and there is an existing

        `secondary` contact with the same `contactType` and `affilation`,

        the status of the existing contact will be automatically changed to

        `additional`.
      enum:
        - primary
        - secondary
        - additional
        - archived
      type: string
    ContactInformationInternal:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - description: >
            The contact details. A contact can be email, phone, address,

            etc. The `name` attribute is optional, and is useful for third-party
            contacts such as

            spouse, attorney, etc.
          properties:
            address:
              $ref: '#/components/schemas/Address'
              nullable: true
            affiliation:
              $ref: '#/components/schemas/ContactAffiliation'
            authorizedThirdParty:
              default: false
              description: >
                Signifies an individual authorized by the borrower to make
                purchases and

                changes against the account that is the subject of the
                collection efforts.

                This attribute is not applicable to contacts with affiliation
                `self`.
              type: boolean
            companyId:
              description: The unique company identifier.
              readOnly: true
              type: string
            contactType:
              $ref: '#/components/schemas/ContactType'
            externalId:
              description: >
                A lender's identifier for an object. After the object is
                successfully created, a lender can use ID or externalId
                identifiers to fetch the object.


                To fetch the object using externalId you need to add `ext-` to
                the URL.


                Note: Don't add ext- to the identifier value. For example: if
                the external identifier is `ABCDE`, then pass externalId=ACBCE
                and NOT ext-ABCDE when creating the object.
              maxLength: 255
              minLength: 1
              nullable: true
              type: string
            label:
              $ref: '#/components/schemas/ContactLabel'
            name:
              description: >
                Full name of a third-party contact. Only applicable for
                third-party contacts, such as `spouse`, `parent`, etc.
              maxLength: 50
              minLength: 0
              nullable: true
              type: string
            object:
              default: contact
              enum:
                - contact
              readOnly: true
              type: string
            personId:
              description: Identifier of the borrower to which the `contact` belongs.
              readOnly: true
              type: string
            phoneDisconnectionDetails:
              properties:
                disconnectionStatus:
                  description: >
                    The disconnect status of a check that was performed on
                    `lastDisconnectCheckDate`. If the value is empty, the
                    disconnect check was not performed on the number. Applicable
                    only to `contactType=phone`.


                    `disconnected` - the number is contained in the Reassigned
                    Numbers Database (RND) and it has been disconnected since
                    the `lastKnownConnectionDate`.

                    `connected` - the number is contained in the Reassigned
                    Numbers Database, and it has NOT been disconnected since the
                    `lastKnownConnectionDate`.

                    `noData` - the number and a permanent disconnect date are
                    not contained in the Reassigned Numbers Database. `noData`
                    value is treated as `disconnected` value in the rules
                    related to outbound communications.
                  enum:
                    - disconnected
                    - connected
                    - noData
                  nullable: true
                  type: string
                lastDisconnectCheckDate:
                  description: >
                    The date when the system performed a disconnect check
                    against the Reassigned Numbers Database.

                    If the value is empty, the disconnect check was not
                    performed on the number. Applicable only to
                    `contactType=phone`.
                  format: date
                  nullable: true
                  type: string
                lastKnownConnectionDate:
                  description: >
                    The date obtained by the borrower to contact them or a past
                    date in which the lender is

                    reasonably certain that the borrower could still be reached
                    at that number. When contact

                    is created the `lastKnownConnectionDate` is equal to
                    `createdAt::date`. This date is used

                    to monitor the disconnect status in the Reassigned Numbers
                    Database (RND).
                  format: date
                  nullable: true
                  type: string
              type: object
            powerOfAttorney:
              default: false
              description: >
                Designated an individual with power of attorney. This attribute
                can only

                be set by agents upon receiving appropriate documents from the
                borrower

                or their attorney. This attribute is not applicable to contacts
                with affiliation `self`.
              type: boolean
            receiveTextMessages:
              default: false
              description: |
                Allows using a `phone` type contact for text messaging.
              type: boolean
            receiveTextMessagesLastConsentAt:
              description: >-
                The date when the `receiveTextMessages` consent was obtained
                (aka set to `true`).
              format: date-time
              nullable: true
              readOnly: true
              type: string
            status:
              $ref: '#/components/schemas/ContactStatus'
            valid:
              default: true
              description: >
                Identifies a contact as valid or invalid. A contact can become
                invalid for multiple reasons, such as wrong format,

                invalid email domain, etc. This attribute can be changed by you
                or by Peach. If no value is provided, we will assume
                valid=`true`.
              type: boolean
            value:
              description: >
                The value of a contact. This attribute should be used for all
                contact types

                except for address, which has dedicated attributes such as

                `addressLine1`, `addressCity`, etc. You should use either
                `value`

                or `address` attributes depending on the contact type. For
                example,

                `+14155552671` for a contact type=`phone`. Or,
                `john.smith@domain.com`

                for a contact type=`email`. We'll validate the format based on
                the contact type.
              nullable: true
              type: string
            verified:
              default: false
              description: >
                Identifies a contact as verified or unverified. Contact can be
                verified

                via a verification code, verification link or a first-party
                outbound call.

                The value can be changed by you or by Peach. If no value is
                provided, we

                will assume verified=`false`.
              type: boolean
          type: object
      title: contactInformation
    ContactInformation:
      allOf:
        - $ref: '#/components/schemas/ContactInformationInternal'
        - properties:
            phoneDisconnectionDetails:
              properties:
                disconnectionStatus:
                  readOnly: true
                lastDisconnectCheckDate:
                  readOnly: true
              type: object
          type: object
      title: contactInformation
    Deceased:
      description: Object describing a deceased borrower case
      properties:
        caseType:
          enum:
            - deceased
          type: string
        dateOfBirth:
          description: The date of birth as reported by the data source.
          format: date
          type: string
        dateOfDeath:
          description: The date of death as reported by the data source.
          format: date
          type: string
        dateOfDeathByAgent:
          description: The date of death as recorded by the agent.
          format: date
          nullable: true
          type: string
        deceasedAddress:
          $ref: '#/components/schemas/Address'
          description: The address as reported by the data source.
        deceasedName:
          $ref: '#/components/schemas/Name'
          description: The name as reported by the data source.
        deceasedNoticeReceivedDate:
          description: >
            The date we became aware of the consumer's death. This is not the
            date of death.

            This notice is received from our internal system.
          format: date
          nullable: true
          type: string
        deceasedNoticeReceivedDateByAgent:
          description: >
            The date you became aware of the consumer's death. This is not the
            date of death.
          format: date
          nullable: true
          type: string
        exactDateOfDeathUnknown:
          description: >-
            In some cases, the exact date of death is unknown. When
            `exactDateOfDeathUnknown` is true, the `dateOfDeath` is only
            accurate to the month and year specified.
          type: boolean
        representativeOfEstateContact:
          $ref: '#/components/schemas/ContactInformation'
          description: Contact details of the legal representative.
          readOnly: true
        representativeOfEstateContactId:
          description: >
            Decedent account holder's contact ID. It can be a legal
            representative,

            or an appointed representative by the deceased.
          nullable: true
          type: string
      title: deceased
      type: object
    DisputeOfDebt:
      properties:
        caseType:
          enum:
            - disputeOfDebt
          type: string
        disputeConfirmedReason:
          description: >-
            The dispute confirmed reason is only used when a case is confirmed
            as disputed.
          enum:
            - APR
            - outstandingBalance
            - monthlyBalance
            - incorrectAtCreditBureau
            - other
          type: string
        disputeNotice:
          description: >-
            ID for the interaction that resulted in the dispute case being
            opened
          nullable: true
          type: string
        noticeReceivedDate:
          description: >
            The first time a Direct Dispute Notice was received from the
            borrower.

            This is when the legal timeline begins.
          format: date
          type: string
        reasonForDispute:
          description: |
            The reason for the dispute of debt.
          enum:
            - inaccurateOrIncompleteDetails
            - loanAlreadyPaidInFull
            - missingCreditedPayments
            - fundsNeverReceived
            - coercedDebt
            - other
          type: string
        scopeOfDispute:
          description: Scope of the dispute.
          enum:
            - entireLoan
            - remainingLoanAmount
            - interestRate
            - fees
            - otherTerms
          type: string
      title: disputeOfDebt
      type: object
    FederalEmergencyDisaster:
      properties:
        declarationDate:
          description: |
            Date the disaster was declared.
          format: date-time
          type: string
        declaredCountyArea:
          description: |
            The name or phrase describing the U.S. county that was
            included in the declaration.
          maxLength: 50
          type: string
        disasterCloseOutDate:
          description: |
            Date all financial transactions for all programs are completed.
          format: date-time
          nullable: true
          type: string
        disasterNumber:
          description: |
            Sequentially assigned number used to designate an event or incident
            declared as a disaster. For more information on the disaster
            process, www.fema.gov.
          type: integer
        disasterType:
          description: |
            Two character code that defines if the disaster is a Major Disaster
            Declaration (DR), Emergency Declaration (EM), Fire Management
            Assistance Declaration (FM), or Fire Suppression Authorization (FS).
            For more information on the disaster process,
            please visit: www.fema.gov.
          maxLength: 2
          minLength: 2
          type: string
        femaId:
          maxLength: 25
          type: string
        fyDeclared:
          description: |
            The fiscal year the disaster was declared.
          type: integer
        hmProgramDeclared:
          description: |
            Denotes whether the Hazard Mitigation program was declared for this
            disaster. For more information on the program,
            please visit: www.fema.gov.
          type: boolean
        iaProgramDeclared:
          description: |
            Denotes whether the Individual Assistance program was declared
            for this disaster. For more information on the program,
            please visit: www.fema.gov.
          type: boolean
        ihProgramDeclared:
          description: |
            Denotes whether the Individuals and Households program was declared
            for this disaster. For more information on the program,
            please visit: www.fema.gov.
          type: boolean
        incidentBeginDate:
          description: |
            Date the incident itself began.
          format: date-time
          type: string
        incidentEndDate:
          description: |
            Date the incident itself ended.
          format: date-time
          nullable: true
          type: string
        incidentType:
          description: |
            Type of incident such as fire or flood. The incident type will
            affect the types of assistance available. For more information on
            incident types, please visit: www.fema.gov.
          maxLength: 100
          type: string
        lastRefresh:
          description: |
            Date the record was last updated in the FEMA API data store.
          format: date-time
          type: string
        paProgramDeclared:
          description: |
            Denotes whether the Public Assistance program was declared for this
            disaster. For more information on the program,
            please visit: www.fema.gov.
          type: boolean
        placeCode:
          description: |
            A unique code system FEMA uses internally to recognize
            locations that takes the numbers "99" + the 3-digit county
            FIPS code. There are some declared locations that don't have
            recognized FIPS county codes in which case we assigned a
            unique identifier.

            We map person's home zip code to FIPS code.
          type: string
        stateCode:
          description: >
            The name or phrase describing the U.S. state, district, or
            territory.
          maxLength: 2
          minLength: 2
          type: string
      type: object
    FederalEmergency:
      properties:
        caseType:
          enum:
            - federalEmergency
          type: string
        disaster:
          allOf:
            - $ref: '#/components/schemas/FederalEmergencyDisaster'
            - readOnly: true
              type: object
        disasterId:
          description: |
            ID of the FEMA disaster
          type: integer
          writeOnly: true
      title: federalEmergency
      type: object
    GenericCase:
      properties:
        caseType:
          enum:
            - generic
          type: string
      title: generic
      type: object
    IdentityTheft:
      properties:
        caseType:
          enum:
            - identityTheft
          type: string
        claimRejectedReason:
          description: >
            The rejected claim reason is only used when a case is deemed

            'not validated.' Only one reason is associated with a set of
            associated loans.
          enum:
            - requestedInformationNotReceived
            - invalidDocumentation
            - insufficientDocumentation
            - householdResponsible
            - namedOnAccount
            - other
          type: string
        reportReceivedDate:
          description: >
            The first time an identity theft report was received from the
            borrower.

            This is when the legal timeline begins.
          format: date
          type: string
      title: identityTheft
      type: object
    LegalAction:
      properties:
        caseType:
          enum:
            - legalAction
          type: string
        legalActionInitiatedDate:
          description: Date the legal action initiated
          format: date
          type: string
        legalJudgmentEffectiveDate:
          description: Legal judgment effective date
          format: date
          type: string
      title: legalAction
      type: object
    MilitaryDuty:
      description: Object describing an active military duty case.
      properties:
        caseType:
          enum:
            - militaryDuty
          type: string
        claimingSCRArights:
          description: The borrower is claiming SCRA rights and protections
          nullable: true
          type: boolean
        dutyCertificateFile:
          description: >-
            The unique identifier for the downloaded certificate file from
            monitoring service.
          nullable: true
          type: string
        dutyCertificateId:
          description: >
            The certificate identifier used to locate a certificate in the
            certificate file.
          type: string
        dutyEndDate:
          description: >
            The duty end date. This is normally populated when duty ends. During
            ongoing duty, the

            value will remain empty.
          format: date
          nullable: true
          type: string
        dutyServiceComponent:
          description: |
            DoD's classification of service positions
          type: string
        dutyServiceComponentDescription:
          description: |
            Description of DoD's classification of service positions
          nullable: true
          type: string
        dutyServiceMatchDate:
          description: |
            The date that DMDC completed the SCRA match.
          format: date
          nullable: true
          type: string
        dutyStartDate:
          description: >
            The duty start date. This is populated when Peach gets the first hit
            from the SCRA database.
          format: date
          type: string
        memberOfPennsylvaniaNationalGuard:
          description: The borrower is a member of Pennsylvania National Guard.
          type: boolean
        onDutyProtectionEligibility:
          description: >-
            The borrower's eligibility for the federal SCRA and/or state
            protections
          enum:
            - federal
            - state
            - federalAndState
          nullable: true
          type: string
      title: militaryDuty
      type: object
    DebtValidation:
      description: Debt validation case
      properties:
        caseType:
          enum:
            - debtValidation
          type: string
        currentStateResidence:
          description: >
            Borrower's current state of residence. Use two character US state
            name abbreviations.
          type: string
        newYorkStateCity:
          description: |
            If the borrower is a New York state resident, specify the city.
          enum:
            - newYorkCity
            - yonkers
            - other
          nullable: true
          type: string
        requestDate:
          description: Date the debt validation was requested.
          format: date
          type: string
      title: debtValidation
      type: object
    Collection:
      description: Collection case
      properties:
        attemptsToContactByPhone:
          properties:
            attempted:
              description: |
                The number of attempted case-associated phone interactions
                with the borrower. Attempted statuses are those not in the
                list of `scheduled`, `canceled`, `inProgress`, or
                `succeeded`.
              type: integer
            successful:
              description: |
                The number of successful case-associated phone interactions
                with the borrower.
              type: integer
          readOnly: true
          type: object
        caseType:
          enum:
            - collection
          type: string
        collectionReachOuts:
          properties:
            capacities:
              items:
                properties:
                  count:
                    description: |
                      How many contacts were made in the last period, ending
                      today.
                    type: integer
                  left:
                    description: |
                      How many contacts are left according to the intensity
                      configuration. `null` if this is not configured.
                    nullable: true
                    type: integer
                  period:
                    description: |
                      The length of the time period, in days.
                    type: integer
                type: object
              type: array
            contacts:
              items:
                properties:
                  count:
                    description: |
                      How many contacts were made on the given day.
                    type: integer
                  date:
                    description: |
                      The date on the contacts were made.
                    format: date
                    type: string
                type: object
              type: array
            intensity:
              description: The borrower's collection intensity rate.
              enum:
                - light
                - normal
                - heavy
              type: string
          type: object
        daysOverdue:
          description: Maximum number of days overdue among overdue or accelerated loans.
          readOnly: true
          type: integer
        isFirstTimeCollection:
          description: |
            Indicates if this is the first time a collections case-type has
            been created for this borrower. Canceled cases are not
            considered.
          readOnly: true
          type: boolean
        lastSuccessfulPayment:
          properties:
            amount:
              description: The amount of the last successful payment (transaction).
              format: float
              type: number
            date:
              description: >-
                The date of the last successful payment (transaction) among
                overdue and accelerated loans.
              format: date
              type: string
          readOnly: true
          type: object
        loansReportedToBureaus:
          enum:
            - 'yes'
            - 'no'
            - some
          readOnly: true
          type: string
        nextPayment:
          description: Closest upcoming payment due of overdue and accelerated loans.
          properties:
            amount:
              description: Upcoming payment amount.
              format: float
              type: number
            date:
              description: Upcoming payment date.
              format: date
              type: string
          readOnly: true
          type: object
        numberOfLoansOverdueOrAccelerated:
          description: Number of associated overdue or accelerated loans.
          readOnly: true
          type: integer
        overdueOrAcceleratedLoanCount:
          description: |
            **DEPRECATED ATTRIBUTE** Use `numberOfLoansOverdueOrAccelerated`.

            Number of associated overdue or accelerated loans.
          readOnly: true
          type: integer
        paymentCount:
          description: |
            **DEPRECATED ATTRIBUTE** Use `paymentCounts`.
          properties:
            failed:
              description: >-
                The number of failed payments (transactions) among overdue and
                accelerated loans.
              type: integer
            total:
              description: >-
                The total number of payment attempts (transactions) among
                overdue and accelerated loans.
              type: integer
          readOnly: true
          type: object
        paymentCounts:
          properties:
            failed:
              description: >-
                The number of failed payments (transactions) among overdue and
                accelerated loans.
              type: integer
            total:
              description: >-
                The total number of payment attempts (transactions) among
                overdue and accelerated loans.
              type: integer
          readOnly: true
          type: object
        totalAmounts:
          properties:
            expected:
              description: >-
                Total amount expected to be paid on overdue and accelerated
                loans.
              format: float
              type: number
            overdue:
              description: Total amount overdue on overdue or accelerated loans.
              format: float
              type: number
            paid:
              description: Total amount paid on overdue and accelerated loans.
              format: float
              type: number
          readOnly: true
          type: object
      title: collection
      type: object
    OFACAddress:
      properties:
        address:
          description: The address.
          type: string
        cityStateProvincePostalCode:
          description: City, state, province, or postal code.
          type: string
        country:
          description: The country.
          type: string
      type: object
    OFACSanctionedIndividual:
      description: Keyword parameters unique to OFAC sanctioned individuals.
      properties:
        caseType:
          enum:
            - oFACSanctionedIndividual
          type: string
        ofacActionsRequired:
          description: The list of standard punitive actions.
          items:
            enum:
              - blockTransaction
              - rejectTransaction
              - closeAccount
              - blockAssets
            type: string
          type: array
        ofacActionsRequiredOther:
          description: Additional punitive actions.
          type: string
        sdnAddressList:
          description: List of addresses.
          items:
            $ref: '#/components/schemas/OFACAddress'
          type: array
        sdnAkaList:
          description: List of AKA's, in the format of "LASTNAME, Firstname".
          items:
            type: string
          type: array
        sdnDateOfBirthList:
          description: >
            Dates of birth. The date may be partial. For example: 10 Dec 1948 or
            1959.
          items:
            type: string
          type: array
        sdnName:
          description: |
            Name of the Specially Designated National.
          properties:
            firstName:
              type: string
            lastName:
              type: string
          type: object
        sdnNationalityList:
          description: |
            List of nationalities. For example: Tunisia.
          items:
            type: string
          type: array
        sdnPlaceOfBirthList:
          description: |
            Places of birth. For example: Cuba.
          items:
            type: string
          type: array
        sdnProgramList:
          description: |
            List of sanction program names. For example: SDNTK or SDGT.
          items:
            type: string
          type: array
        sdnRemarks:
          description: |
            Specially Designated National remarks.
          type: string
        sdnUid:
          description: |
            Unique record identifier/unique listing identifier.
          type: string
      title: oFACSanctionedIndividual
      type: object
    PurchaseDispute:
      allOf:
        - $ref: '#/components/schemas/BaseWithExternalIdMixin'
        - properties:
            cardId:
              description: >
                The Peach identifier of the `Card` linked to the disputed
                purchase (`CD-...`).

                Mirrors `Purchase.cardId` on the underlying purchase.
              nullable: true
              readOnly: true
              type: string
            caseId:
              description: >
                Peach identifier of the case. The case object contains more
                details about the dispute, e.g. evidence information such as
                supporting documents.
              type: string
            companyId:
              description: |
                The unique company identifier.
              readOnly: true
              type: string
            disputedAmount:
              description: >
                The disputed amount. Can be less than the original purchase
                amount. Sum of disputed amounts cannot exceed the original
                purchase amounts (regardless of disputes outcomes).
              format: float
              type: number
            metadata:
              additionalProperties: true
              type: object
            repostedPurchaseId:
              description: >
                The identifier of the reposted purchase. When a borrower loses a
                dispute, the lender normally creates a new purchase in the
                amount of the dispute.
              type: string
            status:
              default: unsubmitted
              description: >
                The status of the dispute. `unsubmitted` is the only valid
                status for a new purchase dispute.


                `unsubmitted` - The dispute is pending submission to a
                processor/network.


                `submitted` - The dispute has been submitted to a
                processor/network.


                `expired` - The dispute has expired.


                `won` - The dispute is won.


                `lost` - The dispute is lost.


                `canceled` - The dispute was canceled. Only `unsubmitted`
                disputes can be canceled.
              enum:
                - unsubmitted
                - submitted
                - expired
                - won
                - lost
                - canceled
              type: string
            timestamps:
              properties:
                expiredAt:
                  format: date-time
                  type: string
                lostAt:
                  format: date-time
                  type: string
                submittedAt:
                  format: date-time
                  type: string
                wonAt:
                  format: date-time
                  type: string
              readOnly: true
              type: object
          type: object
    CanceledDetails:
      properties:
        cancelPolicyProvided:
          description: >
            Whether the borrower was provided with a cancellation policy by the
            merchant.
          type: boolean
        cancelReason:
          description: |
            Reason for canceling the order.
          type: string
        canceledDate:
          description: Date when the order was canceled.
          format: date
          type: string
        expectedDate:
          description: |
            Date the borrower expected to receive the order.
          format: date
          type: string
        productDescription:
          description: |
            Description of the merchandise or service that was purchased.
          type: string
        productType:
          description: >
            Type of product purchased.


            `merchandise` - Tangible goods such as appliances.


            `service` - Intangible goods such as ski lessons or internet
            subscription.
          enum:
            - merchandise
            - service
          type: string
        returnStatus:
          description: |
            Result of borrower's attempt to return the product.

            `succeeded` - The merchant accepted the return.

            `merchantRejected` - The merchant rejected the return.
          enum:
            - succeeded
            - merchantRejected
          type: string
        returnedDate:
          description: Date when the order was returned or attempted to be returned.
          format: date
          type: string
      title: canceledDetails
      type: object
    DuplicateDetails:
      properties:
        cardStatementDocumentId:
          description: >
            Copy of the card statement showing that the product had already been
            paid for.
          type: string
        cashReceiptDocumentId:
          description: >
            Copy of the receipt showing that the product had been paid for in
            cash.
          type: string
        checkImageDocumentId:
          description: >
            Image of the front and back of the check that was used to pay for
            the product.
          type: string
        originalPurchaseExternalId:
          description: >
            External Purchase identifier that the disputed purchase is a
            duplicate of. If the two or more purchases that are copies of each
            other (aka have exact same details), this is the original undisputed
            one.
          type: string
      title: duplicateDetails
      type: object
    MerchandiseNotAsDescribedDetails:
      properties:
        receivedDate:
          description: Date when the product was received.
          format: date
          type: string
        returnDescription:
          description: Description of the borrower's attempt to return the product.
          type: string
        returnStatus:
          description: |
            Result of borrower's attempt to return the product.

            `succeeded` - The merchant accepted the return.

            `merchantRejected` - The merchant rejected the return.
          enum:
            - succeeded
            - merchantRejected
          type: string
      title: merchandiseNotAsDescribedDetails
      type: object
    NotReceivedDetails:
      properties:
        expectedDate:
          description: |
            Date the borrower expected to receive the order.
          format: date
          type: string
        productDescription:
          description: |
            Description of the merchandise or service that was purchased.
          type: string
        productType:
          description: >
            Type of product purchased.


            `merchandise` - Tangible goods such as appliances.


            `service` - Intangible goods such as ski lessons or internet
            subscription.
          enum:
            - merchandise
            - service
          type: string
      title: notReceivedDetails
      type: object
    OtherDetails:
      properties:
        productDescription:
          description: |
            Description of the merchandise or service that was purchased.
          type: string
        productType:
          description: >
            Type of product purchased.


            `merchandise` - Tangible goods such as appliances.


            `service` - Intangible goods such as ski lessons or internet
            subscription.
          enum:
            - merchandise
            - service
          type: string
      title: otherDetails
      type: object
    ServiceNotAsDescribedDetails:
      properties:
        cancelReason:
          description: |
            Reason for canceling the order.
          type: string
        canceledDate:
          description: Date when the order was canceled.
          format: date
          type: string
        receivedDate:
          description: Date when the product was received.
          format: date
          type: string
      title: serviceNotAsDescribedDetails
      type: object
    EvidenceDetails:
      oneOf:
        - $ref: '#/components/schemas/CanceledDetails'
        - $ref: '#/components/schemas/DuplicateDetails'
        - $ref: '#/components/schemas/MerchandiseNotAsDescribedDetails'
        - $ref: '#/components/schemas/NotReceivedDetails'
        - $ref: '#/components/schemas/OtherDetails'
        - $ref: '#/components/schemas/ServiceNotAsDescribedDetails'
    PurchaseDeclineReason:
      description: The reason the purchase was declined
      properties:
        mainExternalReasonCode:
          description: The external decline reason code
          type: string
        mainScriptForRep:
          description: >-
            The main decline reason script that a customer service agent can
            provide to the borrower.
          type: string
        mainText:
          description: The main decline reason text that is shown to the borrower
          type: string
      type: object
    PurchaseMigrationDetails:
      description: >
        Purchase migration related details. This object should be used for lines
        that are migrated from another system to Peach.
      properties:
        originalDrawId:
          description: >
            The draw identifier. Can be Peach or lender's external identifier.


            All past purchases prior to the "migration cutoff date" will be
            posted on the "migration" draw. After the "migration cutoff date",

            a lender can have multiple draws (e.g. Purchases, Cash Withdrawals,
            etc.) Use this attribute to indicate the original draw ID

            that the purchase was posted on in another system. In case of a
            dispute created after the "migration cutoff date", the
            `originalDrawId`

            will be used to adjust the draw balance. The `originalDrawId` is
            required for all purchases that are migrated from another system.
          nullable: true
          pattern: ^ext-|^[A-Z][A-Z0-9]-[A-Z0-9]+-[A-Z0-9]+|^\d+$
          type: string
      required:
        - originalDrawId
      type: object
    PurchaseDetails:
      description: The details of purchase.
      properties:
        categoryId:
          description: The category identifier of the purchase.
          nullable: true
          type: string
        conversionRate:
          description: >
            The conversion rate that was used to convert the purchase amount
            from the `originalCurrencyCode` to the line of credit main currency.

            For example:
               - Line of credit main currency code = `USD`
               - `originalCurrencyCode=GBP`
               - `originalCurrencyAmount=200.45`
               - `conversionRate=1.33`

            Then `amount = 200.45 * 1.33 = 266.59`.
          format: float
          type: number
        description:
          default: Purchase
          description: >
            The description of the purchase. Purchases in authorized status are
            shown in borrower portal but NOT on statements.

            Purchases in `pending` or `succeeded` status are shown in borrower
            portal and on statements.  At least one of the attributes,

            `description` or `merchantName` must be passed
          nullable: true
          type: string
        externalCardId:
          deprecated: true
          description: >
            DEPRECATED. Use the top-level `cardId` field on Create/Update
            Purchase instead, which resolves to a

            Peach `Card` row scoped to the line of credit. This legacy field is
            preserved for back-compat and continues

            to populate the `external_card_id` column verbatim.


            Precedence: if both top-level `cardId` and
            `purchaseDetails.externalCardId` are supplied in the same

            request, top-level `cardId` wins and `externalCardId` is silently
            ignored (no error, no warning).
          nullable: true
          type: string
        isValidMerchantId:
          description: >
            `true` - if the merchant ID exists in Peach Merchants table.


            `false` - if the merchant ID doesn't exist in Peach Merchants table.

            Credit card lenders normally should not create merchants details in
            Peach and `isMerchantIdValid` attribute can be ignored.

            Point of sale lenders normally have merchants details in Peach and
            can use `isMerchantIdValid` attribute as needed.
          readOnly: true
          type: boolean
        merchantCategoryCode:
          description: The merchant category code of the card acceptor (merchant).
          nullable: true
          type: string
        merchantCity:
          description: The city of the merchant.
          nullable: true
          type: string
        merchantCountry:
          description: The country of the merchant.
          nullable: true
          type: string
        merchantId:
          description: The merchant identifier where the purchase was made.
          nullable: true
          type: string
        merchantName:
          description: >-
            The merchant name where the purchase was made. At least one of the
            attributes, `description` or `merchantName` must be passed.
          nullable: true
          type: string
        merchantState:
          description: The state of the merchant.
          nullable: true
          type: string
        metadata:
          description: Store any type of key/value pairs in the form of a JSON dictionary.
          nullable: true
          type: object
        originalCurrencyAmount:
          description: The amount of the purchase before currency conversion.
          format: float
          nullable: true
          type: number
        originalCurrencyCode:
          description: >-
            The currency in which the purchase was made before currency
            conversion. Three letters according to [ISO
            4217](https://en.wikipedia.org/wiki/ISO_4217).
          nullable: true
          pattern: '[A-Z]{3}'
          type: string
        pointOfSaleType:
          description: >
            - `online` - the purchase was made online on a website or in a
            mobile application.

            - `physical` - the purchase was made in a store with a physical card
            or instrument.

            - `recurring` - the purchase was made as part of a subscription
            service.
          enum:
            - online
            - physical
            - recurring
          nullable: true
          type: string
      type: object
    PurchaseStatus:
      description: >
        The status of the purchase.


        - `authorized` - the purchase is authorized and not yet `settled`.
        Authorized purchases are included in `utilizationAmount`, `openToBuy`
        and `availableCreditAmount` calculations; however, authorizations are
        not written to the ledger and are not included in total outstanding loan
        balances.

        - `settled` - the purchase was settled.

        - `pending` - the purchase is pending. `pending` purchases increases the
        draw balance similar to `settled`. Pending status is used mainly
            for visuals and normally shown in Borrower Portal and on statements.
        - `canceled` - the purchase was canceled. `canceled` purchases reduce
        the draw balance. A new purchase cannot be created in `canceled` status.

        - `declined` - the purchase was declined. `declined` purchases reduce
        the draw balance if the status changes from `pending` to `declined`. A
        new purchase can be created in `declined` status for record purposes (it
        will not impact the draw balance).

        - `disputed` - The purchase was disputed for full or partial amount.
        `disputed` status is a terminal state and once set cannot be changed to
        another status. This status can not be set manually. Submitting a
        purchase dispute will set the purchase's status to `disputed`.


        The following status transitions are allowed:

        - `authorized` -> `pending`

        - `authorized` -> `settled`

        - `authorized` -> `canceled`

        - `authorized` -> `declined`

        - `pending` -> `settled`

        - `pending` -> `canceled`

        - `pending` -> `declined`

        - `declined` -> `authorized`

        - `settled` -> `canceled`

        - `settled` -> `disputed` (only by calling "Create purchase dispute")
      enum:
        - authorized
        - pending
        - settled
        - canceled
        - declined
        - disputed
      type: string
    CreatePurchase:
      properties:
        amount:
          description: >
            The amount of the purchase. The amount can be updated only if the
            purchase status is `pending` or `authorized`. The amount and status
            of a purchase may be changed on the same call.
          format: float
          minimum: 0
          type: number
        authorizationPurchaseId:
          description: >
            Peach's unique (or lender's external identifier) for the
            authorization purchase. This attribute is used to reference an
            initial authorization, so

            lenders know which captures (purchase object(s) in Peach) are
            related to the original authorization.
          nullable: true
          type: string
        cardId:
          description: >
            Peach id, Peach public id (`CD-...`), or lender external id
            (`ext-...`) of the card used for this purchase.

            Resolved against cards belonging to this line of credit. If the card
            cannot be resolved (unknown id or wrong loan),

            the purchase is still created and `validation.cardIdMissing` is set
            to `true` in the response.


            In responses from read endpoints, this field is always returned as
            the Peach public id (`CD-...`) or `null`.
          maxLength: 200
          nullable: true
          type: string
        declineReason:
          $ref: '#/components/schemas/PurchaseDeclineReason'
          description: The reason the purchase was declined
          nullable: true
        displayId:
          description: The purchase ID to show in the UI (Peach public or external).
          readOnly: true
          type: string
        drawId:
          description: The unique identifier of the draw that the purchase belongs to.
          readOnly: true
          type: string
        eligibleDisputeAmount:
          description: >
            The maximum amount eligible to be disputed. The amount is dynamic
            and can change depending on past disputes. Sum of disputed amounts
            cannot exceed the original purchase amounts (regardless of disputes
            outcomes).
          format: float
          readOnly: true
          type: number
        externalId:
          $ref: '#/components/schemas/externalId'
          description: The external unique identifier of the purchase.
        id:
          description: The unique identifier of the purchase.
          readOnly: true
          type: string
        lineOfCreditId:
          description: >-
            The unique identifier of the line of credit that the purchase
            belongs to.
          readOnly: true
          type: string
        metadata:
          description: Store any type of key/value pairs in the form of a JSON dictionary.
          nullable: true
          type: object
        migration:
          $ref: '#/components/schemas/PurchaseMigrationDetails'
          nullable: true
        originalAmount:
          description: >
            The original amount of the purchase when it was created. If the
            purchase amount changes after creation, `originalAmount` will not
            change.
          format: float
          readOnly: true
          type: number
        originalPurchaseId:
          $ref: '#/components/schemas/AnyId'
          description: >
            Peach's unique or lender's external identifier. Typically used for
            purchases of type `refund` which allows the lender to

            reference the original purchase being refunded. For authorizations,
            please see `authorizationPurchaseId` attribute.
          nullable: true
        purchaseDate:
          description: >
            The date of a purchase. This attribute can be passed only during the
            line of credit migration process.

            Don't use this attribute after the migration process was
            successfully completed.


            - The value must be before or equal to today, and cannot be greater
            than the "migration at date" (aka the actual date on which you run
            the migration.)

            - If you pass `purchaseDate` you cannot pass `authorizedAt` and/or
            `effectiveAt`.

            - If `purchaseDate` is passed, the system will set `authorizedAt`
            and `effectiveAt` to `purchaseDate` at 6:00 AM in the product
            timezone.

            - If you `purchaseDate` is not passed, you must pass both
            `authorizedAt` and `effectiveAt`. `authorizedAt` cannot be greater
            than `effectiveAt`.


            For non-migrated purchases:

            - The value is equal to the date part of the `authorizedAt`
            converted to the product timezone (e.g. Eastern or Pacific).
              If `authorizedAt` is null, this value is equal to the date part of the purchase's `createdAt` converted to the product timezone.

            The `purchaseDate` is returned in Get endpoints for both migrated
            and non-migrated purchases.
          format: date
          type: string
        purchaseDetails:
          $ref: '#/components/schemas/PurchaseDetails'
        status:
          allOf:
            - $ref: '#/components/schemas/PurchaseStatus'
            - default: settled
        timestamps:
          properties:
            authorizedAt:
              description: >
                The timestamp when the purchase was `authorized`. This value can
                be set by lenders at the time of purchase creation.

                If the value is not set by the lender, it will be populated
                based on `authorizedAt` (if it is non-null) otherwise
                `createdAt` for the corresponding `authorizationPurchaseId`.

                If the value is not set by the lender and no
                `authorizationPurchaseId` is set, this value corresponds to
                `purchase.authorized` event.

                If the purchase was never in `authorized` status and none of the
                prior conditions are met, this value will be null.
              format: date-time
              nullable: true
              readOnly: true
              type: string
            createdAt:
              format: date-time
              readOnly: true
              type: string
            effectiveAt:
              description: >
                The effective timestamp when the purchase was applied in the
                ledger. `effectiveAt` is equal to the timestamp when the
                purchase is set to

                `pending` or `settled` status, whichever comes first. Changing
                the `effectiveAt` via the `Update purchase` endpoint will
                trigger a replay

                of the line of credit. Keep in mind that an existing statement
                might've included the purchase based on the existing
                `effectiveAt` value

                and the interest was accrued based on the existing
                `effectiveAt`. `effectiveAt` can be updated only if the purchase
                is in `settled` or `pending` status.
              format: date-time
              readOnly: true
              type: string
            settledAt:
              description: >-
                The timestamp when the purchase was `settled`. Corresponds to
                `purchase.settled` event.
              format: date-time
              nullable: true
              readOnly: true
              type: string
            updatedAt:
              format: date-time
              readOnly: true
              type: string
          readOnly: true
          type: object
        type:
          description: >
            - `regular` - a regular purchase made by the borrower. Increases
            draw's balance.

            - `refund` - a refund of the purchase made in the past. Decreases
            draw's balance.

            - `cashBack` - cash back given to the borrower by the issuing
            institution.
          enum:
            - regular
            - refund
            - cashBack
          type: string
      required:
        - amount
      title: Purchase
      type: object
    InternalRefundDetails:
      description: >
        The details of how a refund was applied:

         - The system will first deplete any non-due principal. This amount will be stored as `refundNonDuePrincipalAmount`.
         - If any refund amount is left to apply, the system will create a transaction of type `serviceCredit` and
        `serviceCreditType=refund`. This transaction will be applied on the Draw
        level first and any leftover amount will
         be applied on the LOC level (based on the loan type waterfall configuration for payments). This amount will be stored as
          `refundTransactionAmount`.
         - Any unapplied refund amount will be recorded as credit to the borrower (also called `reimbursementAmount`.)
      properties:
        refundNonDuePrincipalAmount:
          description: >
            Amount of refund that was applied to reduce the non-due principal of
            the draw.

            The total amount of refund is equal to `refundNonDuePrinicpalAmount
            + refundTransactionAmount`.
          format: float
          type: number
        refundTransactionAmount:
          description: >
            Amount of refund that was applied to as a transaction to reduce
            other balances of the draw and potentially other draws.

            The total amount of refund is equal to `refundNonDuePrinicpalAmount
            + refundTransactionAmount`.
          format: float
          type: number
        refundTransactionId:
          description: >-
            Reference to the transaction ID of type service credit and
            serviceCreditType=refund. This is Peach Public ID.
          nullable: true
          type: string
      type: object
    Purchase:
      allOf:
        - $ref: '#/components/schemas/CreatePurchase'
        - properties:
            refundDetails:
              $ref: '#/components/schemas/InternalRefundDetails'
              nullable: true
              readOnly: true
          type: object
    DisputeOfPurchase:
      properties:
        caseType:
          enum:
            - disputeOfPurchase
          type: string
        dispute:
          $ref: '#/components/schemas/PurchaseDispute'
        disputeReason:
          description: >
            The reason for filing the dispute.


            `canceled` - Service or merchandise was canceled.


            `serviceNotAsDescribed` - The service was not as described.


            `merchandiseNotAsDescribed` - The merchandise was not as described.


            `duplicate` - There were multiple copies of a charge for a single
            purchase, or the charge was paid by other means.


            `fraudulent` - The borrower did not make the purchase.


            `notReceived` - Merchandise or service was not received.


            `other` - All other types of disputes.
          enum:
            - canceled
            - serviceNotAsDescribed
            - merchandiseNotAsDescribed
            - duplicate
            - fraudulent
            - notReceived
            - other
          type: string
        disputeStatus:
          description: |
            **DEPRECATED ATTRIBUTE** Use `dispute.status`.
          enum:
            - unsubmitted
            - submitted
            - expired
            - won
            - lost
          readOnly: true
          type: string
        evidenceDetails:
          $ref: '#/components/schemas/EvidenceDetails'
        evidenceDocumentId:
          description: Additional document supporting the dispute.
          type: string
        evidenceExplanation:
          description: Description of why the borrower disputes the purchase.
          type: string
        purchase:
          $ref: '#/components/schemas/Purchase'
        purchaseDisputeId:
          description: |
            Peach identifier of the dispute object that belongs to the purchase.
          type: string
        purchaseExternalId:
          description: The external identifier of the disputed purchase.
          type: string
        purchaseId:
          description: >-
            Peach identifier of the disputed purchase. You must supply this
            field or the `purchaseExternalId` when creating a case.
          type: string
      title: disputeOfPurchase
      type: object
    CreditBureauDisputeCodes:
      enum:
        - notMine
        - belongsToAnotherWithSimilarName
        - notAwareOfCollection
        - settlementOrPartialPaymentAccepted
        - claimsPaidCreditorBeforeCollectionOrChargeOff
        - creditLimitOrLoanAmountIncorrect
        - includedInTheBankruptcyOfAnother
        - claimsAccountClosed
        - claimsAccoutClosedByConsumer
        - contractCanceledOrRescinded
        - accountIncludedInBankruptcy
        - claimsActiveMilitaryDuty
        - insuranceClaimDelayed
        - accountInvolvedInLitigation
        - claimsVictimOfNaturalOrDeclaredDisaster
        - claimsAccountDeferred
        - notLiable
        - accountReaffirmedOrNotIncludedInBankruptcy
        - claimsTrueIdentityFraud
        - claimsAccountTakeOver
        - disputesPresentPreviousAccountStatusPaymentRatingAccountHistory
        - disputesPortfolioTypeAccountTypeOrTermsDurationFrequency
        - claimsCompanyWillChange
        - claimsCompanyWillDelete
        - consumerStatesInaccurateInformation
        - disputesDateOpenedDateOfLastPaymentOrDateClosed
        - disputesDateOfFirstDeliquency
        - disputesComplianceConditions
        - disputesSpecialCommentCodeAndOrNarrativeRemarks
        - disputesCurrentBalanceAndOrAmountPastDue
        - disputesOriginalChargeOffPaymentOrScheduledPaymentAmount
        - consumerDisputesDeceasedECOA
      type: string
    CreditBureauDisputeResponseCodes:
      enum:
        - informationAccurateAsOfReportDate
        - deleteAccount
        - misroutedACDV
        - deleteDueToFraud
        - updateDisputedAccountInfoOnly
        - updateDisputedAndAdditionalAccountInfo
        - disputedInformationAccurateUpdatedAdditionalInfo
        - consumersDisputeNotSpecific
        - other
      type: string
    CreditBureauDispute:
      properties:
        bureauDisputeNotice:
          description: >-
            ID for the interaction that resulted in the dispute case being
            opened
          type: string
        caseType:
          enum:
            - creditBureauDispute
          type: string
        disputeCode1:
          $ref: '#/components/schemas/CreditBureauDisputeCodes'
          description: The nature of the consumer's dispute.
        disputeCode2:
          $ref: '#/components/schemas/CreditBureauDisputeCodes'
          description: Optional second dispute reason.
          nullable: true
        disputeReceivedDate:
          description: |
            The date the dispute was received. This is the date the ACDV was
            placed in the data furnisher's queue.
          format: date
          type: string
        fcraInfo:
          description: |
            Contains a description of the FCRA-mandated relevant information
            received from the consumer pertaining to this dispute. This is a
            free-form text area.
          nullable: true
          type: string
        responseCode:
          $ref: '#/components/schemas/CreditBureauDisputeResponseCodes'
          description: |
            A code that indicates the action the data furnisher wants the
            originating agency to take in response to the dispute.
        responseDueDate:
          description: |
            The date by which an ACDV response must be received from a data
            furnisher. After this date, the ACDV is removed from the queue
            and the originating agency will take action per the
            specifications of the Fair Credit Reporting Act (FCRA).
          format: date
          nullable: true
          type: string
      title: creditBureauDispute
      type: object
    CasePut:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - $ref: '#/components/schemas/CaseAttributes'
        - anyOf:
            - $ref: '#/components/schemas/Bankruptcy'
            - $ref: '#/components/schemas/CeaseCommunication'
            - $ref: '#/components/schemas/Deceased'
            - $ref: '#/components/schemas/DisputeOfDebt'
            - $ref: '#/components/schemas/FederalEmergency'
            - $ref: '#/components/schemas/GenericCase'
            - $ref: '#/components/schemas/IdentityTheft'
            - $ref: '#/components/schemas/LegalAction'
            - $ref: '#/components/schemas/MilitaryDuty'
            - $ref: '#/components/schemas/DebtValidation'
            - $ref: '#/components/schemas/Collection'
            - $ref: '#/components/schemas/OFACSanctionedIndividual'
            - $ref: '#/components/schemas/DisputeOfPurchase'
            - $ref: '#/components/schemas/CreditBureauDispute'
      title: case
    Case:
      allOf:
        - $ref: '#/components/schemas/CasePut'
        - properties:
            typeId:
              description: |
                Unique identifier of the case type.
              type: string
          required:
            - typeId
          type: object
      title: case
    OverrideTemplateId:
      description: >
        The template version ID (like `TV-AAAA-BBBB`) *or* template descriptor
        ID (like `TD-AAAA-BBBB`)

        to use.


        If a template descriptor is given, then the current template
        descriptor's `activeVersionId` is

        used.


        This should be used in special cases where you do not want to use the
        implicit template selected 

        by the `subject` and `channel` fields.
      example: TV-AAAA-BBBB
      nullable: true
      type: string
    InteractionStatusDetails:
      description: >
        Provides more details about the status of an interaction.


        Note that `statusDetails` related to the "technical" status of an
        interaction: e.g., Did it connect?

        Did it fail to send? Was it blocked by Compliance Guard?


        For the "human" outcome of an interaction see `agentOutcome`: e.g., Did
        you talk the person you intended

        to? Did the other chat recipient become unresponsive?


        ## Status


        Certain status details must have a particular `status` associated with
        them; attempting to use them

        otherwise will result in an error.


        ### Succeeded


        The following status details are considered `status=succeeded`


        - `emailDelivered` - The email was successfully delivered

        - `emailOpened` - The email was opened

        - `emailClick` - A link in the email was clicked

        - `letterDelivered` - The letter is successfully delivered

        - `chatRead` - The chat message was read


        The following status detail is only available for `mail` interactions
        sent with `mailIsCertified=true`.


        - `letterPickUpAvailable` - Letter is available for pickup at carrier
        location


        ### Attempted


        The following status details are considered `status=attempted`.


        - `voiceReceivedOutsideOpenHours` - Caller tried to contact the lender
        outside designated business hours

        - `voiceConnected` - Voice call connected successfully

        - `voiceDisconnectedBeforeQueue` - Inbound call was disconnected before
        entering the queue.

        - `emailSent` - Email was sent, but delivery cannot be confirmed

        - `letterCreated` - Letter is successfully created

        - `letterRenderedPdf` - Letter's PDF proof is successfully rendered

        - `letterRenderedThumbnails` - Letter's thumbnails are successfully
        rendered

        - `letterInTransit` - Letter received an "In Transit" event

        - `letterInLocalArea` - Letter is in the local area

        - `letterProcessedForDelivery` - Letter is in the local area

        - `letterRerouted` - Letter is re-routed

        - `chatPosted` - Chat message sent

        - `textConvoTimeoutAutoclose` - This text conversation was closed
        automatically due to a timeout.

        - `textConvoClosedStale` - (**DEPRECATED**) An open but outdated text
        conversation was closed automatically when a new text conversation was
        started. New text conversations should never enter into this state, but
        old conversations may be in this state.

        - `textConvoClosedByAgent` - The agent manually marked the text
        conversation as ended.


        The following status details are only available for `mail` interactions
        sent with `mailIsCertified=true`.


        - `letterAccepted` - Letter has been accepted into the carrier network
        for delivery

        - `letterArrived` - Letter has arrived at an intermediate location in
        the carrier network

        - `letterContactCarrier` - Letter has non-failure condition that
        requires contacting the carrier

        - `letterDamaged` - Letter has been damaged; contact carrier for more
        details

        - `letterDelayed` - Letter has been delayed

        - `letterDeliveryAttempted` - Carrier attempted to deliver letter;
        contact carrier to ensure delivery

        - `letterDeliveryRescheduled` - Delivery of letter has been rescheduled

        - `letterDeparted` - Letter has departed from an intermediate location
        in the carrier network

        - `letterHeld` - Letter held at carrier location; contact carrier for
        more details

        - `letterNoticeLeft` - Carrier left notice during attempted delivery;
        follow instructions on notice

        - `letterProcessed` - Letter has been processed at an intermediate
        location

        - `letterProcessing` - Letter is processing at an intermediate location
        in the carrier network

        - `letterOther` - Peach's mail partner received an unrecognized status
        that does not have a predefined code


        ### Failed


        The following status details are considered `status=failed`.


        Generally an interaction is `failed` if some part of connecting or
        completing the interaction failed

        due to a technical failure, misconfiguration, or attempt to communicate
        in a way disallowed by

        rules.


        - `emailBlocked` - Receiving server could not or would not accept the
        message temporarily

        - `emailBounced` - Receiving server could not or would not accept mail
        to this recipient permanently

        - `emailDropped` - Email rejected for a number of reasons: rejected as
        SPAM, Unsubscribed Address, Bounced Address, Email Invalid

        - `emailFailedToSend` - _Not currently in use - reserved for future use_

        - `emailReportedAsSpam` - Email was delivered, but later reported as
        SPAM by recipient

        - `letterDeleted` - Letter is successfully canceled

        - `letterFailedToCreate` - Request to create the letter failed. Provider
        did not return 200 OK status code

        - `letterReturnedToSender` - Letter is returned to the sender

        - `textA2PCampaignUnregistered` - The text was not sent because the
        lender has not registered this phone number with an A2P campaign.

        - `textAccountSuspended` - The account was suspended between message
        queuing and delivery.

        - `textCarrierViolation` - The message was flagged as 'objectionable' or
        'spam' by the phone carrier and was blocked.

        - `textConvoUnknownNumberRejected` - This text was received from an
        unknown number, and so was rejected.

        - `textDeviceUnreachable` - The destination phone number temporarily
        could not be reached - it was turned off, out of service area, etc.

        - `textLandlineOrUnreachableCarrier` - The destination phone number
        could not receive the message. Reasons include the destination number
        being a landline phone or the carrier being temporarily unavailable.

        - `textLenderDisabledInboundTexts` - The inbound text was not received
        because the lender does not have inbound texting enabled.

        - `textMessageBlocked` - The destination phone number is blocked from
        receiving the message.

        - `textMessagePriceExceedsMax` - The price of the message exceeds the
        max price parameter.

        - `textMissingSegment` - One or more parts of a multipart message were
        not received.

        - `textNumberDisconnected` - The destination phone number could not be
        reached and may be disconnected.

        - `textQueueOverflow` - Too many messages were queued to be sent, and
        some were dropped as a result.

        - `textRegionInvalid` - Permission to send an SMS or MMS has not been
        enabled for the region indicated by the 'To' number

        - `textUnknownError` - An unknown error occurred when attempting to send
        the message.

        - `textUnsubscribedRecipient` - The person you are trying to message has
        opted out of receiving messages from your Twilio phone number, Channels
        sender, or Messaging Service.

        - `voiceFailedToInitiate` - Outbound voice call could not start for some
        reason; Or the inbound call was disconnected before entering the queue.

        - `voiceLenderDisabledInboundCalls` - Inbound call received while lender
        has inbound voice call disabled

        - `voiceNumberDisconnected` - Outbound voice call to disconnected phone
        number

        - `voiceNumberInvalid` - Invalid 'To' Phone Number

        - `voiceReceivedNoAgentsAvailable` - Inbound call received while lender
        had no agents to answer it


        The following status details are only available for `mail` interactions
        sent with `mailIsCertified=true`.


        - `letterAddressIssue` - Address information is incorrect; contact
        carrier to ensure delivery

        - `letterDisposed` - Letter disposed by carrier

        - `letterLocationInaccessible` - Delivery location inaccessible to
        carrier; contact carrier to ensure delivery

        - `letterLost` - Letter has been lost; contact carrier for more details

        - `letterRescheduleDelivery` - Contact carrier to reschedule delivery

        - `letterUnclaimed` - Letter is unclaimed

        - `letterUndeliverable` - Letter was unable to be delivered


        ## Channels


        - Most status details can only be used with their respective channels.
        e.g., `voiceNumberDisconnected`
          can only be used for interactions with `channel=voice`. Using them otherwise will result in an error
        - `invalidContact` and `blockedByComplianceGuard` are valid for all
        channels


        ## Direction


        Certain status details are only valid with certain `direction` settings.
        Using them with

        an invalid `direction` will result in an error. For example...

        - `voiceReceivedNoAgentsAvailable` can only be set for `inbound` phone
        calls

        - `voiceNumberDisconnected` can only be set for `outbound` phone calls

        - `voiceUnexpectedDisconnect` can be set for either direction


        ## Null


        Note that `null` is not a valid status name but rather can be used to
        specify a

        query for interactions with a `status` of `null`
      enum:
        - voiceSpokeWithFirstParty
        - voiceSpokeWithThirdParty
        - voiceLeftVoicemailFirstParty
        - voiceLeftVoicemailThirdParty
        - voiceLeftVoicemail
        - voiceLineBusyNoRing
        - voiceReachedVoicemailNoMessageLeft
        - voiceRangNoPickup
        - voicePickedHungUp
        - voiceFailedToInitiate
        - voiceNumberDisconnected
        - voiceReceivedOutsideOpenHours
        - voiceUnexpectedDisconnect
        - voiceDisconnectedBeforeQueue
        - voiceDisconnectedWhileQueuedOnHold
        - voiceReceivedNoAgentsAvailable
        - voiceLenderDisabledInboundCalls
        - voiceConnected
        - voiceNumberInvalid
        - emailSent
        - emailDelivered
        - emailBlocked
        - emailBounced
        - emailOpened
        - emailClick
        - emailDropped
        - emailFailedToSend
        - emailReportedAsSpam
        - letterCreated
        - letterFailedToCreate
        - letterRenderedPdf
        - letterRenderedThumbnails
        - letterProcessedForDelivery
        - letterRerouted
        - letterInLocalArea
        - letterInTransit
        - letterDelivered
        - letterReturnedToSender
        - letterDeleted
        - letterAccepted
        - letterArrived
        - letterProcessing
        - letterProcessed
        - letterDeparted
        - letterPickUpAvailable
        - letterAddressIssue
        - letterContactCarrier
        - letterDelayed
        - letterDeliveryAttempted
        - letterDeliveryRescheduled
        - letterLocationInaccessible
        - letterNoticeLeft
        - letterDamaged
        - letterDisposed
        - letterHeld
        - letterLost
        - letterUnclaimed
        - letterUndeliverable
        - letterRescheduleDelivery
        - letterOther
        - chatPosted
        - chatRead
        - chatBorrowerInactivity
        - chatReceivedOutsideOpenHours
        - textConvoTimeoutAutoclose
        - textConvoClosedStale
        - textConvoUnknownNumberRejected
        - textConvoClosedByAgent
        - textLenderDisabledInboundTexts
        - textUnsubscribedRecipient
        - textQueueOverflow
        - textAccountSuspended
        - textDeviceUnreachable
        - textMessageBlocked
        - textNumberDisconnected
        - textLandlineOrUnreachableCarrier
        - textCarrierViolation
        - textUnknownError
        - textMissingSegment
        - textMessagePriceExceedsMax
        - textA2PCampaignUnregistered
        - textRegionInvalid
        - blockedByComplianceGuard
        - invalidContact
        - 'null'
      nullable: true
      type: string
    BaseTwilioMinimalInteraction:
      properties:
        borrowerSelectedTheme:
          $ref: '#/components/schemas/InteractionTheme'
        channel:
          type: string
        contactId:
          type: string
        content: {}
        id:
          type: string
        metaData:
          $ref: '#/components/schemas/MetaData'
        personId:
          description: The ID of the borrower to which this interaction is associated
          nullable: true
          type: string
        scheduledAtFrom:
          description: |
            Time to start the scheduled interaction.
          format: date-time
          type: string
        scheduledAtTo:
          description: |
            Time to end the scheduled interaction.
          format: date-time
          type: string
        startedAt:
          description: |
            Start time of the interaction. If not provided we'll assume it's
            a timestamp of the API call.  If time of day is not required
            provide only date.

            For CRM-managed `voice` interactions, an `inbound` call is
            considered started when the CRM system answers the call, and an
            `outbound` call is considered started when the CRM system
            initiates the call.
          format: date-time
          type: string
        status:
          $ref: '#/components/schemas/InteractionStatus'
        statusDetails:
          $ref: '#/components/schemas/InteractionStatusDetails'
        subject:
          $ref: '#/components/schemas/InteractionSubject'
        theme:
          $ref: '#/components/schemas/InteractionTheme'
      type: object
    InteractionAgentOutcome:
      description: >
        Provides details on the outcome of the interaction according to an
        agent.


        Note this captures the "human" outcome of an interaction: e.g., Did you
        talk the person you intended

        to? Did the other chat recipient become unresponsive?


        For the "technical" status of an interaction, see `statusDetails`. e.g.,
        : Did it fail to

        send? Was it blocked by Compliance Guard?


        - `voiceSpokeWithFirstParty` - Agent spoke with borrower

        - `voiceSpokeWithThirdParty` - Agent spoke with someone other than the
        borrower

        - `voiceLeftVoicemail` - Agent left voicemail

        - `voiceReachedVoicemailNoMessageLeft` - Agent reached voicemail but did
        not leave a message

        - `voiceRangNoPickup` - Phone rang, no voicemail was reached, and the
        call ended, or the agent hung up

        - `voiceLineBusyNoRing` - Agent reached busy phone line

        - `voicePickedHungUp` - Agent heard call pick up and immediate hang up

        - `voiceDisconnectedWhileQueuedOnHold` - Caller hung up while on hold

        - `voiceUnexpectedDisconnect` - The call was unexpectedly disconnected

        - `voiceFailedToInitiate` - Outbound voice call could not start for some
        reason

        - `voiceNumberDisconnected` - Outbound voice call to disconnected phone
        number
      enum:
        - voiceSpokeWithFirstParty
        - voiceSpokeWithThirdParty
        - voiceLeftVoicemail
        - voiceLineBusyNoRing
        - voiceReachedVoicemailNoMessageLeft
        - voiceRangNoPickup
        - voicePickedHungUp
        - voiceFailedToInitiate
        - voiceNumberDisconnected
        - voiceUnexpectedDisconnect
      nullable: true
      type: string
    InteractionIntensityCollDebt:
      default: normal
      description: >
        Defines the maximum number of interactions per period(s) on a compliance

        level related to FDCPA or state debt collection rules. Lenders can
        configure intensities

        based on their business needs. For example, prime borrowers can be
        defined as `light`,

        and a lender can define the maximum number of attempts or successful
        interactions to be

        2 in any 7-calendar-day period.
      enum:
        - light
        - normal
        - heavy
      type: string
    UserBase:
      properties:
        companyId:
          readOnly: true
          type: string
        externalId:
          nullable: true
          type: string
        roleIds:
          description: |
            List of role IDs associated with this user.
          items:
            type: string
          nullable: true
          type: array
        status:
          enum:
            - active
            - inactive
          type: string
        type:
          description: >
            The type of user to create:


            - `borrower` - This user allows a borrower to log in to the system.

            - `agent` - This user allows an agent to log in to the system.

            - `service` - This user is used in conjunction with an API key to
            perform background tasks.
          enum:
            - borrower
            - agent
            - service
          type: string
      type: object
    UserAuth:
      properties:
        authType:
          $ref: '#/components/schemas/AuthType'
        authValueType:
          $ref: '#/components/schemas/AuthValueType'
        value:
          type: string
      readOnly: true
      type: object
    UserAuthList:
      items:
        $ref: '#/components/schemas/UserAuth'
      readOnly: true
      type: array
    UserBasic:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - $ref: '#/components/schemas/UserBase'
        - properties:
            auths:
              $ref: '#/components/schemas/UserAuthList'
            object:
              default: user
              enum:
                - user
              readOnly: true
              type: string
            userId:
              description: The ID of the associated user
              type: number
            userName:
              readOnly: true
              type: string
          type: object
    BasePersonNoIdentity:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - description: >

            Represents various users such as a borrower,

            co-borrower, co-signer, etc. A lender can choose to provide PII or
            not.

            If no PII is provided, Peach cannot monitor for bankruptcy, deceased
            and

            SCRA.
          properties:
            borrowerType:
              default: person
              description: The type of borrower.
              enum:
                - person
                - business
              type: string
            collectionsIntensity:
              $ref: '#/components/schemas/InteractionIntensityCollDebt'
            commPreferences:
              description: The borrower's communication preferences.
              properties:
                sendRemindersWhenCurrent:
                  default: true
                  description: >
                    When set to `true`, the system sends payment reminders when
                    the loan is current.

                    When set to `false` the system sends payment reminders only
                    when the loan is overdue.
                  type: boolean
                statementDeliveryChannels:
                  description: >
                    A list of channels that loan statements will be delivered.

                    If value(s) are not passed, the system will use the
                    statement default channel from company's configuration.

                    Borrower can modify their preferences later.
                  items:
                    enum:
                      - email
                      - mail
                    type: string
                  type: array
              type: object
            companyId:
              description: |
                The unique company identifier.
              type: string
            displayId:
              description: The loan ID to show in the UI (Peach public or external).
              readOnly: true
              type: string
            externalId:
              description: >
                A lender's identifier for a borrower. After the object is
                successfully created, a lender can use ID or externalId
                identifiers to fetch the object.


                To fetch the object using externalId you need to add `ext-` to
                the URL.


                Note: Don't add ext- to the identifier value. For example: if
                the external identifier is `ABCDE`, then pass externalId=ACBCE
                and NOT ext-ABCDE when creating the object.
              nullable: true
              type: string
            metaData:
              $ref: '#/components/schemas/MetaData'
            monitorStartDate:
              description: >
                This attribute is only applicable to lenders who use Compliance
                Guard Monitor to monitor borrowers without active loans.

                `monitorStartDate` is currently used for Bankruptcy monitoring
                only in the following way.


                Bankruptcy:


                The system will return only bankruptcy cases that were filed on
                or after the `monitorStartDate`.

                If date is passed (recommended), any bankruptcy cases filed
                prior to the date will be filtered and not returned.

                We recommend lenders to pass origination date of the earliest
                active loan in their system.

                If date is not passed, the system will set the date equal the
                borrower creation date.
              format: date
              nullable: true
              type: string
            status:
              default: active
              description: |
                When a new borrower object is created, we set the value to
                `active` by default. Set to `inactive` at any time.
              enum:
                - active
                - inactive
              type: string
            statusUpdatedAt:
              description: The time of a status update.
              format: date-time
              nullable: true
              readOnly: true
              type: string
            user:
              allOf:
                - $ref: '#/components/schemas/UserBasic'
                - readOnly: true
          type: object
    InteractionDirection:
      enum:
        - outbound
        - inbound
      type: string
    TaskType:
      enum:
        - answerInboundVoiceCall
        - handleInboundInteraction
        - handleUnboundInboundInteraction
        - makeScheduledCall
        - replyToNewConvo
        - replyToNewText
        - replyToNewWebChat
        - replyToAbandonedWebChat
        - reviewEscalatedCaseAgent
        - reviewEscalatedCaseAgentUrgent
        - reviewEscalatedCaseTeam
        - reviewEscalatedCaseTeamUrgent
        - reviewDocumentUpload
        - reviewSnoozedCase
        - reviewAutoCreatedCase
        - reviewAutoUpdatedCase
        - reviewCaseInstructions
        - reviewVoicemail
        - smartReviewCase
      type: string
    AssociatedLoanId:
      description: >
        The ID of a Loan. This marks a particular loan as associated with this
        interaction.
      example: LN-AAAA-BBBB
      type: string
    AssociatedLoanIds:
      description: >-
        The IDs of several loans. This marks several loans as associated with
        this interaction.
      example:
        - LN-AAAA-BBBB
        - LB-CCCC-DDDD
      items:
        type: string
      type: array
    BaseInteraction:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - $ref: '#/components/schemas/BaseTwilioMinimalInteraction'
        - properties:
            agentOutcome:
              $ref: '#/components/schemas/InteractionAgentOutcome'
            agentOutcomeUpdatedAt:
              description: The datetime of the last `agentOutcome` update.
              format: date-time
              nullable: true
              readOnly: true
              type: string
            borrower:
              $ref: '#/components/schemas/BasePersonNoIdentity'
            companyId:
              description: |
                The unique company identifier.
              readOnly: true
              type: string
            complianceGuardRuleId:
              description: >
                The Compliance Guard rule identifier that blocked the
                interaction.

                Only applicable if the `statusDetails=blockedByComplianceGuard`
                and a rule actually blocked the interaction.

                In some cases the interaction can be blocked before rules are
                checked (e.g. a borrower is missing an address).

                In such a case the `complianceGuardRuleId` will be empty/null.
              nullable: true
              type: string
            contact:
              $ref: '#/components/schemas/ContactInformation'
            contactExternalId:
              description: >
                The lender's identifier of the contact information.


                This should not include any `ext-` prefix as we know this is an
                external ID field.
              nullable: true
              type: string
              writeOnly: true
            createdBy:
              $ref: '#/components/schemas/UserActionInfo'
              description: |
                Details of the user responsible for initiating the interaction.
                Can be an agent or automated system process.
            direction:
              $ref: '#/components/schemas/InteractionDirection'
            endedAt:
              description: >
                End time of the interaction. This attribute is optional and is
                used

                for logging only.


                For CRM-managed `voice` interactions, a call is considered ended

                when either the borrower or the agent disconnects.
              format: date-time
              nullable: true
              type: string
            externalId:
              description: >
                The lender's identifier for the interaction.


                After the object is successfully created, a lender can use ID or
                externalId identifiers to fetch the object.


                To fetch the object using externalId you need to add `ext-` to
                the URL.


                Note: Don't add ext- to the identifier value. For example: if
                the external identifier is `ABCDE`, then pass externalId=ACBCE
                and NOT ext-ABCDE when creating the object.
              maxLength: 255
              minLength: 1
              nullable: true
              type: string
            failureDescriptionLong:
              description: >
                Detailed text describing the failure reason and any appropriate
                actions the user may take to fix the issue.
              nullable: true
              type: string
            failureDescriptionShort:
              description: >
                Short text describing the failure reason. Normally displayed in
                UI.
              nullable: true
              type: string
            isExternal:
              description: |
                Boolean indicating the source of an Interaction. If `true`, the
                interaction was supplied by the lender via API. If `false`,
                the interaction was created by Peach.
              type: boolean
            isTransactional:
              description: >
                `true` when this interaction is considered "transactional".


                Transactional interactions are those which are sent via an
                automated system in response

                to an event or some action taken. e.g., an email sent to confirm
                a payment was made is transactional;

                likewise an email sent to confirm a password change is
                transacrtional. Examples of

                non-transactional messages would be: those sent by an agent in
                response to a customer request,

                for collections, or for marketing.


                It's important to mark these messages correctly, because
                different laws may apply to messages

                depending on if they're considered "transactional".


                Note: Can be `null` for interactions sent before the
                transactional-ness was added to the API.
              nullable: true
              type: boolean
            lastTaskMeta:
              description: >
                The last task that was terminated (completed or canceled) for
                this interaction.
              nullable: true
              properties:
                assignedEmployee:
                  properties:
                    firstName:
                      description: >
                        The first name of the employee which was assigned to
                        this task.
                      nullable: true
                      type: string
                    id:
                      description: |
                        The ID of the employee which was assigned to this task.
                      nullable: true
                      type: string
                    lastName:
                      description: >
                        The last name of the employee which was assigned to this
                        task.
                      nullable: true
                      type: string
                    userId:
                      description: >
                        The ID of the user of the employee which was assigned to
                        this task.
                      nullable: true
                      type: string
                  type: object
                assignmentStatus:
                  description: |
                    The status of the task assignment.
                  enum:
                    - completed
                    - canceled
                  type: string
                sid:
                  description: The SID of the task
                  type: string
                taskInitAt:
                  description: >
                    The time the task was originally created. (If an original
                    task was marked as "Unable to Complete",

                    and a new task was created, this will be the time of the
                    original task.)
                  format: date-time
                  type: string
                taskType:
                  $ref: '#/components/schemas/TaskType'
              type: object
            loanId:
              $ref: '#/components/schemas/AssociatedLoanId'
            loanIds:
              $ref: '#/components/schemas/AssociatedLoanIds'
            object:
              default: interaction
              enum:
                - interaction
              readOnly: true
              type: string
            personId:
              description: The ID of the borrower to which this interaction is associated
              nullable: true
              type: string
            previousInteractionId:
              description: >
                If a previous interaction identifier is provided, the current
                and

                previous interactions will be linked. This can either be Peach's
                or a lender's

                external identifier.
              nullable: true
              type: string
            sendAt:
              description: >
                If set, records the time that the associated notification was
                Scheduled

                to be sent.
              format: date-time
              nullable: true
              readOnly: true
              type: string
            sensitive:
              default: false
              description: >
                Set this flag if this interaction has sensitive information. The
                flag

                is used for proper authorization of access to the information.
              nullable: true
              type: boolean
            sensitiveBorrowerOnly:
              default: false
              nullable: true
              readOnly: true
              type: boolean
            statusDetailsUpdatedAt:
              description: The datetime of the last `statusDetails` update.
              format: date-time
              nullable: true
              readOnly: true
              type: string
            statusUpdatedAt:
              description: The time of a status update.
              format: date-time
              nullable: true
              readOnly: true
              type: string
            supercaseBulkOperationId:
              description: >-
                If a `SupercaseBulkOperation` created this interaction, this is
                that ID
              nullable: true
              readOnly: true
              type: string
            templateVersionId:
              description: >-
                Peach internal template identifier that was used to render the
                interaction.
              nullable: true
              readOnly: true
              type: string
            twilioErrorCode:
              description: |
                Raw error code from Twilio SMS service. The full list of codes
                can be found at https://www.twilio.com/docs/api/errors .
              maxLength: 10
              nullable: true
              type: string
          type: object
      title: BaseInteraction
    GenericInteraction:
      allOf:
        - properties:
            channel:
              description: |
                The channel by which an interaction occurs.
              enum:
                - fax
                - gui
                - document
              type: string
            content:
              description: >-
                The content and attributes of the message sent. Normally in JSON
                format.
              nullable: true
              type: object
          type: object
        - $ref: '#/components/schemas/BaseInteraction'
      title: GenericInteraction
    PhoneNumber:
      description: |
        An E.164 formatted phone number—a phone number prefixed with a `+` and
        a country code. (Note that in the United States this is `+1`)
      example: '+12024561111'
      type: string
    VoiceInteraction:
      allOf:
        - properties:
            channel:
              description: >
                The channel by which an interaction occurs—always `voice` for
                `VoiceInteraction`
              enum:
                - voice
              type: string
            content:
              properties:
                from:
                  $ref: '#/components/schemas/PhoneNumber'
                to:
                  $ref: '#/components/schemas/PhoneNumber'
              type: object
            holdDuration:
              default: null
              description: |
                The amount of time the inbound caller was on hold before
                speaking to an agent, in seconds. `null` if the caller wasn't on
                hold.
              nullable: true
              type: number
            inboundCallAcceptedBy:
              $ref: '#/components/schemas/UserActionInfo'
              description: >
                Details of the user responsible for accepting the inbound call
                task.
            isAutodialed:
              default: false
              description: >
                `true` if an autodialed call. If no value is passed, we'll
                assume

                isAutodialed=`false`—meaning a manual call was performed.


                For more information on why this is important reference the

                Telephone Consumer Protection Act (TCPA).
              nullable: true
              type: boolean
            recordingConsentGiven:
              default: false
              description: |
                `true` if the borrower has given consent to record the call.
              nullable: true
              type: boolean
            recordingDuration:
              description: >
                The duration of the recording of this voice call in seconds, or
                `null` if there

                is no recording.
              nullable: true
              type: integer
            recordingStartedAt:
              description: >
                The date-time at which the recording of this voice call started,
                or `null`

                if there is no recording.
              format: date-time
              nullable: true
              type: string
            twilioConferenceFriendlyName:
              description: |
                The Twilio conference friendly name for this voice interaction.
              nullable: true
              type: string
            twilioConferenceSid:
              description: |
                The Twilio conference SID for this voice interaction.
              nullable: true
              type: string
            voicemailDuration:
              description: >
                The duration of the voicemail of this voice call in seconds, or
                `null` if there

                is no voicemail.
              nullable: true
              type: integer
            voicemailStartedAt:
              description: >
                The date-time at which the voicemail left for this call started,
                or `null`

                if there is no voicemail.
              format: date-time
              nullable: true
              type: string
          type: object
        - $ref: '#/components/schemas/BaseInteraction'
      title: VoiceInteraction
    EmailObj:
      description: Email information
      properties:
        email:
          description: >
            The email address—must include an `@` symbol.


            The email must be formatted like the string `abby@example.com`—it
            cannot be like the

            string `Abby Doe <abby@example.com>`.
          type: string
        name:
          description: The name associated with the email address
          nullable: true
          type: string
      type: object
    EmailInteraction:
      allOf:
        - properties:
            channel:
              description: >
                The channel by which an interaction occurs—always `email` for
                `EmailInteraction`.
              enum:
                - email
              type: string
            content:
              properties:
                content:
                  description: >
                    The content of the email.


                    This is `null` when the interaction is marked as
                    `sensitive=true` and the requesting user

                    does not have permission to read sensitive content.
                  items:
                    anyOf:
                      - properties:
                          type:
                            enum:
                              - text/html
                            type: string
                          value:
                            description: >
                              The HTML body of the email.


                              **WARNING**: The HTML content of the email could
                              be received from untrusted

                              sources. Caution should be used rendering it into
                              a webpage. The data should

                              be sanitized and/or escaped. See
                              https://owasp.org/www-community/attacks/xss/.
                            type: string
                        title: HTML email body
                        type: object
                      - properties:
                          type:
                            enum:
                              - text/plain
                            type: string
                          value:
                            description: |
                              The plain text of the email body.
                            type: string
                        title: Plain text email body
                        type: object
                  nullable: true
                  type: array
                from:
                  allOf:
                    - description: The email information of the sender
                      type: object
                    - $ref: '#/components/schemas/EmailObj'
                personalizations:
                  items:
                    properties:
                      bcc:
                        items:
                          $ref: '#/components/schemas/EmailObj'
                        type: array
                      cc:
                        items:
                          $ref: '#/components/schemas/EmailObj'
                        type: array
                      to:
                        items:
                          $ref: '#/components/schemas/EmailObj'
                        type: array
                    type: object
                  type: array
                subject:
                  description: The subject of the email.
                  type: string
              type: object
            emailInReplyTo:
              description: |
                The contents of the `In-Reply-To` header, the unique [RFC5322
                email message
                ID](https://www.ietf.org/rfc/rfc5322.html#section-3.6.4)
                associated with the email being replied to. `null` if the header
                wasn't present in the email.
              nullable: true
              type: string
            emailMessageId:
              description: |
                The contents of the `Message-ID` header, the unique [RFC5322
                email message
                ID](https://www.ietf.org/rfc/rfc5322.html#section-3.6.4)
                associated with this email. `null` if the header wasn't present
                in the email.
              nullable: true
              type: string
            emailReferences:
              description: |
                The contents of the `References` header, a structured string of
                [RFC5322 email message
                IDs](https://www.ietf.org/rfc/rfc5322.html#section-3.6.4) that
                identify the messages making up the email thread. `null` if the
                header wasn't present in the email.
              nullable: true
              type: string
          type: object
        - $ref: '#/components/schemas/BaseInteraction'
      title: EmailInteraction
    ConvoMessage:
      properties:
        author:
          type: string
        body:
          nullable: true
          type: string
        date_created:
          format: date-time
          type: string
        participant_sid:
          description: SID of the participant that sent the message
          type: string
        sent_with_attachments:
          type: boolean
        sid:
          description: SID of the message
          type: string
      title: Conversation Message
      type: object
    TextConvoParticipant:
      properties:
        attributes:
          properties:
            borrowerId:
              description: >-
                If this is a borrower participant, the borrower ID of the
                borrower.
              nullable: true
              type: string
            contactId:
              description: Always `null` for webchat type participants.
              nullable: true
              type: string
            employeeId:
              description: >-
                If this is an employee participant, the employee ID of the
                employee.
              nullable: true
              type: string
          type: object
        identity:
          description: A unique string tracking the user in the Twilio chat system
          type: string
        messaging_binding:
          description: Always `null` for webchat type participants.
          nullable: true
          type: object
        sid:
          description: The SID of the participant
          type: string
      title: Text Conversation Participant
      type: object
    TextInteraction:
      allOf:
        - properties:
            channel:
              description: >
                The channel by which an interaction occurs—always `text` for
                `TextInteraction``.
              enum:
                - text
              type: string
            content:
              anyOf:
                - nullable: true
                  properties:
                    body:
                      description: Body of the text message
                      type: string
                    from:
                      allOf:
                        - nullable: true
                          type: object
                        - $ref: '#/components/schemas/PhoneNumber'
                    from_name:
                      description: Name of the text sender
                      nullable: true
                      type: string
                    to:
                      $ref: '#/components/schemas/PhoneNumber'
                  title: Outbound text interactions
                  type: object
                - nullable: true
                  properties:
                    messages:
                      items:
                        $ref: '#/components/schemas/ConvoMessage'
                      type: array
                    participants:
                      additionalProperties:
                        $ref: '#/components/schemas/TextConvoParticipant'
                      description: >
                        Each "property name" of this object is a participant SID
                        and each value is an object

                        describing the participant.
                      type: object
                  title: Inbound text interactions
                  type: object
            twilioConvoSid:
              description: >
                The Twilio conversation SID associated with this interaction.
                (Only valid for interactions with a channel of text or chat)
              nullable: true
              readOnly: true
              type: string
          type: object
        - $ref: '#/components/schemas/BaseInteraction'
      title: TextInteraction
    ChatConvoParticipant:
      properties:
        attributes:
          properties:
            borrowerId:
              description: >-
                If this is a borrower participant, the borrower ID of the
                borrower.
              nullable: true
              type: string
            contactId:
              description: Always `null` for webchat type participants.
              nullable: true
              type: string
            employeeId:
              description: >-
                If this is an employee participant, the employee ID of the
                employee.
              nullable: true
              type: string
          type: object
        identity:
          description: A unique string tracking the user in the Twilio chat system
          type: string
        messaging_binding:
          description: Always `null` for webchat type participants.
          nullable: true
          type: object
        sid:
          description: The SID of the participant
          type: string
      title: Webchat Conversation Participant
      type: object
    ChatInteraction:
      allOf:
        - properties:
            channel:
              description: >
                The channel by which an interaction occurs—always `chat` for
                `ChatInteraction`
              enum:
                - chat
              type: string
            content:
              nullable: true
              properties:
                messages:
                  items:
                    $ref: '#/components/schemas/ConvoMessage'
                  type: array
                participants:
                  additionalProperties:
                    $ref: '#/components/schemas/ChatConvoParticipant'
                  description: >
                    Each key of this object is a participant SID and each value
                    is an object

                    describing the participant.
                  type: object
              type: object
            twilioConvoSid:
              description: >
                The Twilio conversation SID associated with this interaction.
                (Only valid for interactions with a channel of text or chat)
              nullable: true
              readOnly: true
              type: string
          type: object
        - $ref: '#/components/schemas/BaseInteraction'
      title: ChatInteraction
    MailInteraction:
      allOf:
        - properties:
            channel:
              description: >
                The channel by which an interaction occurs—always `mail` for
                `MailInteraction`
              enum:
                - mail
              type: string
            mailIsCertified:
              default: false
              description: >
                Whether or not this mail interaction is sent as [USPS Certified

                Mail](https://faq.usps.com/s/article/Certified-Mail-The-Basics).
                Certified

                mail provides proof of mailing and has more granular tracking

                events, but incurs additional cost. Please refer to your order

                form for more pricing information.


                NOTE: Sending as certified mail is currently only supported for

                the following subjects:
                  - `loanRightToCurePersonalUnsecured`
                  - `loanRightToCurePersonalUnsecuredColorado`
                  - `loanRightToCurePersonalUnsecuredDC`
                  - `loanRightToCurePersonalUnsecuredIowa`
                  - `loanRightToCurePersonalUnsecuredKansas`
                  - `loanRightToCurePersonalUnsecuredMaine`
                  - `loanRightToCurePersonalUnsecuredMissouri`
                  - `loanRightToCurePersonalUnsecuredSouthCarolina`
                  - `loanRightToCurePersonalUnsecuredWestVirginia`
                  - `loanRightToCurePersonalUnsecuredWisconsin`
              type: boolean
            mailNumberOfPages:
              nullable: true
              type: integer
          type: object
        - $ref: '#/components/schemas/BaseInteraction'
      title: MailInteraction
    Interaction:
      anyOf:
        - $ref: '#/components/schemas/GenericInteraction'
        - $ref: '#/components/schemas/VoiceInteraction'
        - $ref: '#/components/schemas/EmailInteraction'
        - $ref: '#/components/schemas/TextInteraction'
        - $ref: '#/components/schemas/ChatInteraction'
        - $ref: '#/components/schemas/MailInteraction'
    CompanyAppDomain:
      properties:
        companyId:
          description: The company ID
          readOnly: true
          type: string
        domain:
          description: The company app domain
          type: string
        id:
          description: The app domain ID
          readOnly: true
          type: string
        type:
          enum:
            - borrower
            - agent
            - help
            - admin
          type: string
      type: object
    CompanyConfigSamlAuth:
      properties:
        metadataUrl:
          oneOf:
            - description: The metadata URL to use for all SAML authentication
              example: https://example.com/app123/samlmetadata
              type: string
            - additionalProperties: false
              properties:
                admin:
                  description: The metadata URL for the admin login SAML authentication
                  example: https://example.com/federationmetadata.xml?appid=123
                  type: string
                agent:
                  description: The metadata URL for the agent login SAML authentication
                  type: string
                borrower:
                  description: The metadata URL for the borrower login SAML authentication
                  example: https://example.com/federationmetadata.xml?appid=234
                  type: string
              type: object
        nameIdFormat:
          type: string
      type: object
    CompanyConfigBorrowerVerification:
      properties:
        crmDefaultTypeId:
          description: >-
            The ID of the borrower verification type used when an agent
            initiates a borrower verification via the CRM.

            The borrower verification type is the configuration which specifies
            how many of a particular type of verification question to ask when
            an agent verifies a borrower's identity.
          example: VT-1234-ABDE
          type: string
      type: object
    CompanyConfigCollections:
      properties:
        autoClose:
          properties:
            closeOnlyWhenPaidOff:
              default: false
              description: >-
                If true, keep the collection case open even when the overdue
                loan is charged off or frozen.
              type: boolean
            enabled:
              default: false
              type: boolean
          type: object
        autoInitiate:
          properties:
            collectionCaseTypeId:
              description: >-
                Public ID of the case type to be used when creating a new
                collection case.
              type: string
            enableReviewTask:
              default: true
              description: >
                By default, when a collection case is created automatically, a
                task of type `reviewAutoCreatedCase`

                is created in taskrouter—the assumption being that usually a
                human should

                review automatically created cases.


                To disable the creation of this task set this config to `false`.
              type: boolean
            enabled:
              default: false
              type: boolean
            inspectionProcName:
              description: >-
                The name of the inspection procedure to run on the borrower's
                account.
              type: string
            interactionDaysPassedThreshold:
              description: |
                Number of days to wait after the last loan overdue notification
                was sent. The number depends on the loan's due dates frequency.
              properties:
                everyTwoWeeks:
                  type: integer
                monthly:
                  type: integer
                twiceMonthly:
                  type: integer
                weekly:
                  type: integer
              type: object
            loanDaysOverdueThreshold:
              description: |
                Number of days to wait before creating a new collection case.
                The number depends on the loan's due dates frequency.
              properties:
                everyTwoWeeks:
                  type: integer
                monthly:
                  type: integer
                twiceMonthly:
                  type: integer
                weekly:
                  type: integer
              type: object
            nOverdueNoticesRequired:
              description: |
                The number of different loan overdue notices required to be sent
                before a new collection case is created.
              type: integer
            nPastCollectionsThreshold:
              description: >
                Create a collection case if the number of past collections
                exceeds

                this number.
              type: integer
            totalOverdueAmountThreshold:
              description: >
                The sum of overdue amounts of all overdue loans has to exceed
                this

                value for the collection case to be created.
              type: integer
          type: object
        intensityLimits:
          additionalProperties:
            properties:
              heavy:
                type: integer
              light:
                type: integer
              normal:
                type: integer
            type: object
          description: Keys are strings where each number is a period in days
          type: object
      type: object
    CompanyConfigDataOutbox:
      properties:
        compressionFormat:
          default: gzip
          description: |
            Compression format of files delivered.
          enum:
            - gzip
            - snappy
          type: string
        deliveryFrequency:
          default: 1h
          description: |
            Frequency of data deliveries.
          enum:
            - 15m
            - 1h
            - 1d
          type: string
        destinationBucket:
          description: |
            The name of the bucket to use for data outbox.
          type: string
        destinationProvider:
          default: gcp
          description: |
            The provider of the bucket to use for data outbox.
          enum:
            - gcp
            - aws
            - azure
          type: string
        destinationRegion:
          description: >
            The region of the bucket to use for data outbox. This is only
            required if the destination provider is `gcp` or `aws`.
          type: string
        fileFormat:
          default: parquet
          description: |
            Format of files delivered. Currently, only Parquet is supported.
          enum:
            - parquet
            - avro
          type: string
        googleServiceAccount:
          description: |
            The Google Cloud service account to use for data outbox.
          nullable: true
          type: string
      type: object
    CompanyConfigMonitoring:
      properties:
        criteria:
          description: >
            The criteria used to determine whether monitoring should be enabled
            for a borrower.


            Monitoring will be enabled:

            - `borrowerStatus`: if the borrower `status` is `active`

            - `borrowerAndLoanStatus`: if the borrower `status` is `active` and
            the borrower has loans with `status`=`active`
          enum:
            - borrowerStatus
            - borrowerAndLoanStatus
          type: string
        scraCaseCreationCriteria:
          description: >
            The criteria used to determine whether a SCRA case should be created
            for a borrower.


            A SCRA case will be created:

            - `borrowerOnly`: Upon borrower identity match, SCRA case will be
            created even if there are no loans that are qualified per
                              SCRA regs. If there are eligible loans, the case will associate them.
            - `borrowerAndLoan`: Upon borrower identity match, SCRA case will be
            created only if there are qualified loans per SCRA regs.
          enum:
            - borrowerOnly
            - borrowerAndLoan
          type: string
      type: object
    CompanyConfigPaymentExternalTransaction:
      properties:
        statusTransition:
          description: >
            Enables lenders to control whether Peach's system will automatically
            intervene and transition the status of `pending` transactions to
            `successful` according to the `transitionLogic` configuration.


            - `auto` - Peach's system will automatically transition `pending`
            transactions to `succeeded` after a specified period of time as
            defined by `externalTransactions.transitionLogic`

            - `manual` - Lender is responsible for transitioning the status of
            external transactions via API.
          enum:
            - auto
            - manual
          type: string
        transactionType:
          enum:
            - ach
            - debitCard
            - creditCard
            - check
            - payroll
            - moneyOrder
            - wire
            - paymentNetwork
          type: string
        transitionLogic:
          description: >
            Required for statusTransition = `auto`. Defines the logic used to
            determine when the external transaction's status will transition
            from `pending` to `succeeded`, assuming no other status changes
            occur in the meantime.


            - `numDays`` - Peach's system will wait a specified amount of time
            in order to automatically transition the status of the transaction
            from `pending` to `succeeded`.
              **NOTE**: any transactions whose status is not pending will be excluded from the logic to automatically transition the status of a payment.

            - `holdDays`` - Peach's system will adhere to the holdDaysEndDate on
            the transaction and automatically transition the status of the
            transaction from `pending` to `succeeded` at the end of the hold day
            period.
              **NOTE**: Peach will only transition transactions with status = `pending`.
          properties:
            dayType:
              description: >
                Defines whether the system should calculate the automatic status
                transition based on calendar or business days. NOTE: this is a
                required attribute for products whose statusTransition is set to
                `auto` AND the transitionLogic is set to `numDays`.

                This value cannot be set when type=holdDays.
              enum:
                - calendar
                - business
              type: string
            numDays:
              description: >
                Defines how many days the system will wait to automatically
                update the transaction's status if transitionLogic.type =
                numDays.

                This value cannot be set when transitionLogic.type=`holdDays`.

                The system will transition the status of the transaction on the
                Nth day.

                For example, if a transaction is created on Jan 1 and numDays =
                3, the

                transaction's status will automatically transition on Jan 4.
              type: integer
            type:
              enum:
                - numDays
                - holdDays
              type: string
          type: object
      type: object
    CompanyConfigTasks:
      properties:
        channelCapacities:
          description: |
            The capacity configured for each task for channel type.

            The default capacity for:
            - `default` is `2` (i.e., tasks without a channel)
            - `voice` is `1`
            - `chat` is `3`
          properties:
            chat:
              minimum: 0
              nullable: true
              type: integer
            default:
              minimum: 0
              nullable: true
              type: integer
            email:
              minimum: 0
              nullable: true
              type: integer
            text:
              minimum: 0
              nullable: true
              type: integer
            voice:
              minimum: 0
              nullable: true
              type: integer
          type: object
        disableTaskRouter:
          description: >
            If `true` disable all task routing features.


            i.e., Agents will not log in to task system. Tasks will not be
            created.
          type: boolean
        disableTaskTypes:
          description: >
            List of task types to disable.


            When a task type is disabled the system functions as normal except
            no task

            is created.


            Note that some task types which are allowed to be disabled here
            probably would be

            better served disabled elsewhere. For instance, disabling
            `answerInboundVoiceCall`

            would mean that incoming voice calls are still able to be received
            by the Peach

            system, but cannot be answered by agents! In this case, it would be
            better to

            set the config `communication.enableInboundVoiceCall=false`.
          items:
            $ref: '#/components/schemas/TaskType'
          type: array
        enableCaseOwnership:
          description: |
            Enable optionally assigning an owner to Case objects. This will be
            used during task routing to prefer to match tasks relating to cases
            with their owners.
          type: boolean
      type: object
    CompanyConfigWebhooks:
      properties:
        requestTimeoutSeconds:
          description: |
            The number of seconds the system will wait for a response
            from a webhook before timing out.
          maximum: 300
          minimum: 30
          nullable: true
          type: integer
      type: object
    CompanyConfigZendeskSSO:
      properties:
        sso:
          properties:
            enabled:
              type: boolean
            sharedSecretToken:
              description: The shared secret token.
              type: string
            subdomain:
              description: Subdomain of the remote log in URL.
              type: string
          type: object
      type: object
    CompanyConfig:
      description: >
        The company configuration object is the main location to store
        configuration

        settings to control the functionality and appearance of the Peach

        applications which this company users.
      properties:
        addressValidation:
          default: smartyStreets
          description: Vendor to use for address validation.
          enum:
            - smartyStreets
            - googleMaps
          type: string
        allowPartialAddress:
          default: false
          description: >
            If `true`, Address Line 1 is Optional, otherwise it is required for
            loans managed by Peach
          type: boolean
        auth:
          properties:
            saml:
              $ref: '#/components/schemas/CompanyConfigSamlAuth'
          type: object
        borrowerVerification:
          $ref: '#/components/schemas/CompanyConfigBorrowerVerification'
        brandAssets:
          $ref: '#/components/schemas/CompanyConfigBrandAssets'
          nullable: true
        collections:
          $ref: '#/components/schemas/CompanyConfigCollections'
        communication:
          $ref: '#/components/schemas/CompanyConfigCommunication'
          nullable: true
        compliance:
          description: Compliance guard related configuration parameters
          properties:
            no_review_task_for_autocreated_cases:
              description: >
                If `true` then assume that cases automatically created via
                Compliance

                Guard do not need to be reviewed by a human. If `false` or
                unset, then

                whenever Compliance Guard automatically creates a case, create a

                corresponding task for an agent to review the newly created
                case.
              type: boolean
            no_review_task_for_autoupdated_cases:
              description: >
                If `true` then assume that cases automatically updated via
                Compliance

                Guard do not need to be reviewed by a human. If `false` or
                unset, then

                whenever Compliance Guard automatically updates certain cases,
                create a

                corresponding task for an agent to review the updated case.

                Note that only a subset of automatically updated cases will
                generate a

                review task even with this setting enabled. Those are
                `bankruptcy` and

                `militaryDuty`.
              type: boolean
            rndCompanyId:
              description: Reassigned Numbers Database Company ID
              type: string
          type: object
        creditCounselingServicesNumber:
          type: string
        dataOutbox:
          $ref: '#/components/schemas/CompanyConfigDataOutbox'
        documents:
          description: Document processing related configuration parameters.
          properties:
            signer_contact:
              description: Signer's contact information to be added to the signature.
              type: string
            signer_location:
              description: Signer's location (e.g. "Oakland, CA, USA")
              type: string
            signing_key:
              description: Document signing key in PKCS 12 format.
              type: string
            signing_key_password_token:
              description: Token corresponding to the signing key password.
              type: string
          type: object
        evidence:
          $ref: '#/components/schemas/CompanyConfigEvidence'
        forceCaseIdOnAgentActions:
          default: true
          description: If true, a loan action made by an agent must come with a case ID.
          type: boolean
        links:
          $ref: '#/components/schemas/CompanyConfigLinks'
          nullable: true
        monitoring:
          $ref: '#/components/schemas/CompanyConfigMonitoring'
        openHours:
          $ref: '#/components/schemas/CompanyConfigOpenHours'
          nullable: true
        payment:
          description: Payment processing configuration.
          properties:
            allowedCreditCardTx:
              description: Controls how credit cards can be used.
              properties:
                downPayment:
                  default: true
                  description: If true, down payments are allowed with credit cards.
                  type: boolean
                payment:
                  default: false
                  description: >-
                    If true, regular loan payments are allowed with credit
                    cards.
                  type: boolean
              type: object
            bypassCollisionCheck:
              description: >-
                Allow the creation of multiple payment instruments with the same
                details within the same company.
              type: boolean
            disablePaymentProcessing:
              default: false
              description: >
                When set to `true`, Peach will not process payments or allow
                creation of transactions where `isExternal=false`.

                Existing internal transactions will be canceled on their
                scheduled date. Lenders can continue to create and process
                external transactions.

                Use `scheduleAutopayTransactions` to control whether external
                autopay transactions will automatically be created by Peach.
              type: boolean
            externalTransactions:
              description: >
                Enables lenders to configure treatment of external transactions
                by Peach's system.
              items:
                $ref: '#/components/schemas/CompanyConfigPaymentExternalTransaction'
              type: array
            maxNumberNewPaymentMethodsIn30Days:
              description: >
                If a borrower has created a Payment Instrument this many times
                in the past 30 days,

                they will be blocked from creating anymore. This does not apply
                to `external` instruments, or instruments created with
                `force=true`.
              type: number
            processedByPeach:
              description: Whether Peach handles payment processing for this company.
              type: boolean
            scheduleAutopayTransactions:
              default: false
              description: >
                Only applicable if `processedByPeach=false`.

                `true` - the system will create transactions in scheduled status
                based on Autopay plan expected payments (aka AEPs).

                `false` - the system will not create Autopay transactions based
                on Autopay plan expected payments. In this case, the lender is
                expected to create applicable transactions.
              type: boolean
            transactionLimitAmount:
              default: 100000
              description: Maximum amount for a single transaction
              type: integer
          type: object
        paymentTypes:
          $ref: '#/components/schemas/CompanyConfigPaymentTypes'
        requireBorrowerIdentity:
          default: true
          description: Require new borrowers to have identity information.
          type: boolean
        search:
          properties:
            indexing:
              properties:
                enabled:
                  default: true
                  description: If false, data will not be indexed in elastic search
                  type: boolean
              type: object
          type: object
        statements:
          $ref: '#/components/schemas/CompanyConfigStatements'
        support:
          $ref: '#/components/schemas/CompanyConfigSupport'
          nullable: true
        tasks:
          $ref: '#/components/schemas/CompanyConfigTasks'
        timezone:
          $ref: '#/components/schemas/CompanyConfigTimezone'
          nullable: true
        ui:
          $ref: '#/components/schemas/CompanyConfigUi'
          nullable: true
        webhooks:
          $ref: '#/components/schemas/CompanyConfigWebhooks'
        zendesk:
          $ref: '#/components/schemas/CompanyConfigZendeskSSO'
      title: Company Config
      type: object
    Company:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            agentAuthType:
              $ref: '#/components/schemas/AuthType'
              description: Type of agent authentication, e.g. `basic` or `google`
            agentAuthValueType:
              $ref: '#/components/schemas/AuthValueType'
              description: >-
                When using `authType=basic` (i.e., user/password
                authentication), require this method of authentication (e.g.
                `email`)
            appDomains:
              items:
                $ref: '#/components/schemas/CompanyAppDomain'
              type: array
            bankruptcyPolicy:
              type: boolean
            bankruptcyServiceId:
              description: >-
                The service that will be used for bankruptcy monitoring (no
                monitoring if is null)
              type: integer
            borrowerAuthType:
              $ref: '#/components/schemas/AuthType'
              description: Type of borrower authentication, e.g. `basic` or `google`
            borrowerAuthValueType:
              $ref: '#/components/schemas/AuthValueType'
              description: >-
                When using `authType=basic` (i.e., user/password
                authentication), require this method of authentication (e.g.
                `email`)
            brandName:
              description: >
                The name of the company for presentation to the end
                consumer—e.g., in emails.
              nullable: true
              type: string
            config:
              $ref: '#/components/schemas/CompanyConfig'
            deceasedPolicy:
              type: boolean
            deceasedServiceId:
              description: >-
                The service that will be used for deceased monitoring (no
                monitoring if is null)
              type: integer
            domainName:
              description: Base web domain being used in communications/email/etc
              type: string
            femaPolicy:
              description: >
                If set to `true`, automatically create Supercases when a
                disaster is detected in the region

                of a borrower's address.
              type: boolean
            femaServiceId:
              description: >-
                The service that will be used for FEMA disaster monitoring (no
                monitoring if is null)
              type: integer
            legalName:
              description: Legal name of the company
              type: string
            name:
              description: Alternate name for the company
              type: string
            object:
              enum:
                - company
              readOnly: true
              type: string
            ofacServiceId:
              description: >-
                The service that will be used for OFAC monitoring (no monitoring
                if is null)
              type: integer
            rndServiceId:
              description: >-
                The service that will be used for OFAC monitoring (no monitoring
                if is null)
              type: integer
            scraServiceId:
              description: >-
                The service that will be used for SCRA military monitoring (no
                monitoring if is null)
              type: integer
            shortDomainName:
              description: Base web domain being used in communications/email/etc
              type: string
            slug:
              description: >
                A slug to be used to match this company in other environments
                (dev/sandbox/etc).

                It will also be used for FE hosting and the default DNS entries
                created for it.
              maxLength: 50
              minLength: 1
              type: string
            status:
              default: active
              description: The status of the company.
              enum:
                - active
                - activeChurning
                - inactive
              type: string
            timezone:
              $ref: '#/components/schemas/CompanyConfigTimezone'
              nullable: true
            tokenizationKeyId:
              type: integer
            type:
              description: Type enumerator for companies
              type: string
          type: object
      description: >
        The company object represents a company of Peach which uses some of
        Peach's applications.


        It contains metadata about the company and configuration settings for
        how the applications

        should function.
    BaseMixinWithoutTimestamps:
      properties:
        id:
          readOnly: true
          type: string
      type: object
    PersonType:
      description: |
        A relation type between a borrower and a loan.

        Use `coBorrower` as the value if there are two or more borrowers.
      enum:
        - coBorrower
        - coSigner
        - applicant
      type: string
    CancellationReason:
      description: |
        The cancellation reason:

        `technicalIssue` - loan was created due to a technical issue.

        `wrongLoanTerms` - loan was created with the wrong terms.

        `wrongBorrower` - loan was created on the wrong borrower.

        `other` - for any other reason requiring cancellation.
      enum:
        - technicalIssue
        - wrongLoanTerms
        - wrongBorrower
        - other
      type: string
    LoanLabel:
      allOf:
        - $ref: '#/components/schemas/BaseWithExternalIdMixin'
        - properties:
            companyId:
              description: |
                The unique company identifier.
              readOnly: true
              type: string
            description:
              description: >
                An optional description of the loan label. Typically used to
                store additional details or

                an explanation about the label. Not displayed in any user
                interfaces.
              type: string
            name:
              description: >
                The name of the label. This is the name that will appear in the
                agent (and admin, if applicable) portals.
              type: string
          type: object
    BaseLoanMixin:
      properties:
        additionalBorrowers:
          items:
            properties:
              externalId:
                description: >-
                  The borrower's external ID if this related borrower has one,
                  otherwise `null`
                readOnly: true
                type: string
              id:
                description: ID of the related borrower
                type: string
              name:
                description: >-
                  The related borrower's full name (or business's name if this
                  is a business).
                readOnly: true
                type: string
              relationType:
                $ref: '#/components/schemas/PersonType'
            type: object
          nullable: true
          type: array
        assetDisplayName:
          description: >
            The asset display name. For example: Loan, Line of Credit, Lease,
            Credit Card.
          readOnly: true
          type: string
        cancellationReason:
          allOf:
            - $ref: '#/components/schemas/CancellationReason'
              nullable: true
            - readOnly: true
        declineReason:
          description: >-
            The reason(s) why the loan application or the draw request was
            declined.
          nullable: true
          properties:
            mainExternalReasonCode:
              description: A Lender's external main decline reason code.
              type: string
            mainScriptForRep:
              description: >-
                The main decline reason script that a customer service agent can
                provide to the borrower.
              type: string
            mainText:
              description: The main decline reason text that was shown to the borrower.
              type: string
            subReasons:
              items:
                properties:
                  externalReasonCode:
                    description: A Lender's external decline reason code.
                    type: string
                  reasonText:
                    description: The decline reason text that was shown to the borrower.
                    type: string
                  scriptForRep:
                    description: >-
                      The decline reason script that a customer service agent
                      can provide to the borrower.
                    type: string
                type: object
              type: array
          type: object
        displayId:
          description: The loan ID to show in the UI (Peach public or external).
          readOnly: true
          type: string
        endDate:
          description: The end date of the loan in the product timezone, if amortized.
          format: date
          nullable: true
          readOnly: true
          type: string
        externalId:
          description: >
            A lender's identifier for a loan or a draw.


            After the object is successfully created, a lender can use ID or
            externalId identifiers to fetch the object.


            To fetch the object using externalId you need to add `ext-` to the
            URL.


            Note: Don't add ext- to the identifier value. For example: if the
            external identifier is `ABCDE`, then pass externalId=ACBCE and NOT
            ext-ABCDE when creating the object.
          minLength: 1
          nullable: true
          type: string
        labels:
          items:
            $ref: '#/components/schemas/LoanLabel'
          type: array
        metaData:
          $ref: '#/components/schemas/MetaData'
        timestamps:
          description: Various loan timestamps.
          properties:
            acceleratedAt:
              description: >
                The timestamp of the effective date of the acceleration of a
                loan or draw. A

                previously accelerated loan that has been reversed will be
                marked as null.
              format: date-time
              nullable: true
              type: string
            activatedAt:
              description: The timestamp when the loan or the draw was activated.
              format: date-time
              nullable: true
              type: string
            canceledAt:
              description: The timestamp of when the loan was canceled
              format: date-time
              nullable: true
              type: string
            chargedOffAt:
              description: >
                The timestamp of the effective date of the charge-off of a loan
                or draw. A

                previously accelerated loan that has been reversed will be
                marked as null.
              format: date-time
              nullable: true
              type: string
            closedAt:
              description: The date LOC or Draw was closed.
              format: date-time
              nullable: true
              type: string
            createdAt:
              format: date-time
              readOnly: true
              type: string
            deletedAt:
              format: date-time
              nullable: true
              readOnly: true
              type: string
            frozenAt:
              description: >
                The timestamp of the most recent freeze date of a loan or draw.
                A previously frozen

                loan that has been reversed will be marked as null.
              format: date-time
              nullable: true
              type: string
            lastAmortizedAt:
              description: >
                The most recent date when the loan or the draw was amortized.
                Due dates schedule change

                can cause to re-amortization.
              format: date-time
              nullable: true
              readOnly: true
              type: string
            migratedAt:
              description: The timestamp of when the loan completed loan migration.
              format: date-time
              nullable: true
              type: string
            originatedAt:
              description: The timestamp when the loan or draw was originated.
              format: date-time
              nullable: true
              type: string
            paidOffAt:
              description: >
                The timestamp of the effective date when a loan or draw is
                paidOff.
              format: date-time
              nullable: true
              type: string
            startedAt:
              description: The timestamp when the loan or the draw was activated.
              format: date-time
              nullable: true
              type: string
            updatedAt:
              format: date-time
              nullable: true
              readOnly: true
              type: string
          type: object
      type: object
    OldConsumerAccountNumber:
      description: >
        The old Account Number that was assigned to this account in the other
        system

        (not Peach) prior to migration. The new Account Number that will be
        reported

        is the loan `externalId` or Peach Public ID.


        Do not include embedded blanks or special characters. If

        `changeIndicator=2`, this field should be left empty or blank filled.
      maxLength: 30
      minLength: 1
      nullable: false
      type: string
    MigrationL2SegmentCANOnly:
      properties:
        changeIndicator:
          description: |
            The change indicator field.

            - `1` = Consumer Account Number Change ONLY.
            - `2` = Identification Number Change ONLY.
            - `3` = Consumer Account Number AND Identification Number Change.
          enum:
            - '1'
          type: string
        oldConsumerAccountNumber:
          $ref: '#/components/schemas/OldConsumerAccountNumber'
      required:
        - changeIndicator
        - oldConsumerAccountNumber
      type: object
    OldIdentificationNumber:
      description: >
        The old Identification Number that was used in the other system (not
        Peach)

        prior to migration. The new Identification Number that will be reported
        is

        as configured in Peach.


        Do not include embedded blanks or special characters. If

        `changeIndicator=1`, this field should be left empty or blank filled.
      maxLength: 20
      minLength: 1
      nullable: false
      type: string
    MigrationL2SegmentIDNOnly:
      properties:
        changeIndicator:
          description: |
            The change indicator field.

            - `1` = Consumer Account Number Change ONLY.
            - `2` = Identification Number Change ONLY.
            - `3` = Consumer Account Number AND Identification Number Change.
          enum:
            - '2'
          type: string
        oldIdentificationNumber:
          $ref: '#/components/schemas/OldIdentificationNumber'
      required:
        - changeIndicator
        - oldIdentificationNumber
      type: object
    MigrationL2SegmentBoth:
      nullable: true
      properties:
        changeIndicator:
          description: |
            The change indicator field.

            - `1` = Consumer Account Number Change ONLY.
            - `2` = Identification Number Change ONLY.
            - `3` = Consumer Account Number AND Identification Number Change.
          enum:
            - '3'
          type: string
        oldConsumerAccountNumber:
          $ref: '#/components/schemas/OldConsumerAccountNumber'
        oldIdentificationNumber:
          $ref: '#/components/schemas/OldIdentificationNumber'
      required:
        - changeIndicator
        - oldConsumerAccountNumber
        - oldIdentificationNumber
      type: object
    MigrationL2Segment:
      description: |
        The L1 Segment provides an automated method for changing the
        Consumer Account Number and/or Identification Number and should be
        reported only one time per record to affect the change.

        If you migrate an account to Peach, and want to include the L1
        segment, you need to pass all the applicable attributes in this
        object.
      discriminator:
        mapping:
          '1': '#/components/schemas/MigrationL2SegmentCANOnly'
          '2': '#/components/schemas/MigrationL2SegmentIDNOnly'
          '3': '#/components/schemas/MigrationL2SegmentBoth'
        propertyName: changeIndicator
      oneOf:
        - $ref: '#/components/schemas/MigrationL2SegmentCANOnly'
        - $ref: '#/components/schemas/MigrationL2SegmentIDNOnly'
        - $ref: '#/components/schemas/MigrationL2SegmentBoth'
    Migration:
      description: >
        Loan migration details. This structure should be used for loans that are
        migrated from another system to Peach.

        To migrate a loan (see migration guidance for full details):
          1. Create a new loan in `pending` or `originated` status. The loan must be in `originated` before proceeding to the next step.
          2. Call relevant endpoints to create past payments, refunds, etc.
          3. Call `Migrate loan` endpoint.
      properties:
        activatedDate:
          description: >-
            The activation date of the migrated loan in the product timezone.
            The date must be in the past.
          format: date
          type: string
          writeOnly: true
        activatedTimeOfDay:
          allOf:
            - $ref: '#/components/schemas/TimeOfDay'
            - description: >-
                The effective time of day on `activatedDate` in the product
                timezone.
              type: object
          writeOnly: true
        creditReporting:
          additionalProperties: false
          description: >-
            Instructions to the Peach system on how to report a migrated
            account.
          properties:
            dateClosed:
              description: >
                Legacy-system date the account was closed. If provided, Peach
                uses this value for Metro2 "Date Closed"; otherwise Peach
                derives it from Peach close/payoff events.
              format: date
              nullable: true
              type: string
            dateOfFirstDelinquency:
              description: >
                The date of first delinquency as of the "migration cutoff

                date". This attribute is required to accurately report
                delinquency

                data. If the migrated account is delinquent (based on the Metro2

                definition) or was delinquent in the past, then you must pass
                the

                `dateOfFirstDelinquency`.


                For more details of how to determine this value, please refer to
                the

                most recent Metro2 Credit Reporting Resource Guide.
              format: date
              nullable: true
              type: string
            k2Segment:
              additionalProperties: false
              description: >
                The K2 Segment may be used to report the name of the company
                from

                which the account was purchased or the name of the company to
                which

                the account was sold.


                If you migrate an account to Peach, and want to include the K2

                segment, you need to pass all the applicable attributes in this

                object.


                Please review the notes below per the Metro2 Credit Reporting
                Resource Guide:

                  - If the company that purchased the accounts will not report the
                    prior history, the seller must report the accounts as sold to
                    reflect the final status.

                  - If the account is delinquent or derogatory, it is imperative
                    that you provide the date of the first delinquency that led to
                    the account being sold to the debt purchaser.

                  - If the company that purchased the accounts is converting the
                    account history to their system, the seller should not report
                    the accounts as sold. In this situation, the seller and
                    purchaser should work together with the data representatives at
                    the consumer reporting agencies, who will assist you with
                    conversion of the accounts.

                  - If the lender who sold the accounts reported them as "purchased
                    by another company" or the history cannot be verified for the
                    account prior to purchase, report the Base and K2 Segment
                    fields.

                    - If the new lender is unable to obtain the Date of First
                      Delinquency with the original lender, do not report the
                      account.

                    - Payment history that occurred with the previous lender, which
                      is already on the consumer's file, must not be reported by the
                      new lender.

                  - If the previous lender's account history is being converted to
                    the new lender's system and the account history can be verified,
                    report the Base, K2 Segment and L1 Segment fields.

                    - If the new lender is unable to obtain the Date of First
                      Delinquency with the original lender, do not report the
                      account.

                    - Make sure to configure the Identification Number to be the
                      same as reported by the previous lender.

                    - Make sure to pass loan `externalId` as the Account Number
                      reported by the previous lender.
              nullable: true
              properties:
                purchasedFromName:
                  description: >-
                    Contains the name of the company from which the account was
                    purchased.
                  maxLength: 30
                  minLength: 1
                  type: string
              required:
                - purchasedFromName
              type: object
            l1Segment:
              $ref: '#/components/schemas/MigrationL2Segment'
            paymentHistoryProfile:
              description: >
                The payment history profile of the account prior to the
                migration date.


                The format of this attribute is a string of exactly 24

                characters. Peach will use the provided history profile of the

                account to report the history up to 24 months. After the
                migration

                cutoff date, Peach will start reporting "new/current" payment

                behavior and use part of the `paymentHistoryProfile` data.


                For example:
                  Migration from date = Jan 11, 2022 (this is also a statement date)
                  paymentHistoryProfile = `000011000000EEEE0000BBBB`

                  Data represents, from left to right, 12/31/2021 back through
                  01/31/2020. The E's indicate that the account was current with a
                  zero balance in 12/2020, 11/2020, 10/2020 and 09/2020. The B's
                  indicate that no payment history was available prior to 05/2020,
                  which was most likely the date account was opened.

                Peach will first report the account on Feb 1, 2022:
                  Date of Account Information = 01/31/2022 (represents the reporting period of 01/01/2022 through 01/31/2022)
                  Account Status Code = 11
                  Peach will report the PHP field as is - `000011000000EEEE0000BBBB`.

                Peach will report the account again on Mar 1, 2022:
                  Date of Account Information = 02/31/2022 (represents the reporting period of 02/01/2022 through 02/28/2022)
                  Peach will use part of the original value passed in the `paymentHistoryProfile` and report the PHP field as `0000011000000EEEE0000BBB`. Note that Peach didn't use the last "B" from the original value that was passed.

                For more details of how to determine this value, please refer to
                the

                most recent Metro2 Credit Reporting Resource Guide. The below
                was

                copied from the Metro2 2022 Credit Reporting Resource Guide:


                > Contains up to 24 months of consecutive payment activity for
                the
                   previous 24 reporting periods prior to the Date of Account
                   Information (Field 24) being reported. Report one month's payment
                   history in each byte from the left to right in most recent to
                   least recent order. The first byte should represent the Account
                   Status Code reported in the previous reporting period. Refer to
                   Exhibit 5 for examples of reporting payment history, which
                   includes examples for month-end reporters, as well as examples
                   for reporters who submit data on other days of the month (e.g.,
                   1st, 15th, etc.).
                >

                > `0` = 0 payments past due (current account)

                > `1` = 30 - 59 days past due date

                > `2` = 60 - 89 days past due date

                > `3` = 90 - 119 days past due date

                > `4` = 120 - 149 days past due date

                > `5` = 150 - 179 days past due date

                > `6` = 180 or more days past due date

                > `B` = No payment history available prior to this time – either
                because the account was not open or because the payment history
                cannot be furnished. A "B" may not be embedded within other
                values.

                > `D` = No payment history reported/available this month. "D"
                may be embedded in the payment history profile.

                > Note: Code "D" should not be used as a default value or
                reported to remove accurately-reported history.

                > `E` = Zero balance and Account Status 11 – Current (0-29 days
                past the due date)(Applies to Credit Cards and Lines of Credit)

                > `G` = Collection

                > `H` = Foreclosure Completed

                > `J` = Voluntary Surrender

                > `K` = Repossession

                > `L` = Charge-off

                >

                > No other values are acceptable in this field.


                If this value is not provided, Peach will report PHP as
                "unknown"

                from the "activation date" until the "migration cutoff date"
                using a

                special code `B` based on the Metro2 Credit Reporting Resource

                Guide.
              maxLength: 24
              minLength: 24
              nullable: true
              pattern: ^[0123456BDEGHJKL]{24}$
              type: string
          type: object
          writeOnly: true
        migrationStatus:
          default: nonMigrated
          description: >
            The loan migration status. This attribute can be updated by the
            Peach system only.

              - `nonMigrated` - this is a non-migrated loan. Most loans are expected to be `nonMigrated`.
              - `prepMigration` - the lender can add objects to the loan in the past.
              - `migrating` - the system is migrating the loan. Objects cannot be modified or added.
              - `completed` - the loan was successfully migrated. After a successful migration the loan status will be changed to one of the following statuses: `active`, `accelerated`, `chargedOff` or `paidOff`.
              - `failed` - the loan migration attempt failed. The loan will remain in the `pending` status. You can update the loan details and try to migrate again by calling `Migrate loan` endpoint.
          enum:
            - nonMigrated
            - prepMigration
            - migrating
            - completed
            - failed
          type: string
      title: Migration
      type: object
    SharedInstallmentAndLoc:
      properties:
        assetType:
          $ref: '#/components/schemas/LoanAssetType'
          readOnly: true
        chargedOffReason:
          description: >
            The reason for loan charge off. Can be updated via the Update Loan
            endpoint when the loan status is `chargedOff`.


            `term` means the loan was charged off per loan type configuration
            after X days overdue.


            `fraudulent` means the loan was charged off for fraudulent reason.
            If the loan is reported to one or more credit bureaus, the system
            will automatically send a special request to each bureau to delete
            the tradeline due to confirmed fraud. This is the only reason that
            the system will automatically trigger a request to delete the
            tradeline. For other reasons, if you need to delete the tradeline
            please call the `Delete from credit reporting` endpoint or use an
            agent tool.


            `bankruptcy` means the loan was charged off because of bankruptcy.


            `legal` means the loan was charged off because of some legal reason.
          enum:
            - term
            - fraudulent
            - bankruptcy
            - legal
          nullable: true
          type: string
        companyId:
          description: |
            The unique company identifier.
          readOnly: true
          type: string
        mainBorrowerId:
          description: The identifier of the main borrower of the loan
          nullable: true
          type: string
        migration:
          allOf:
            - $ref: '#/components/schemas/Migration'
            - required:
                - migrationStatus
                - activatedDate
                - activatedTimeOfDay
              type: object
      type: object
    PersonId:
      description: |
        A borrower's unique identifier (who owns the loan). Can be Peach
        or a lender's external identifier.
      type: string
      writeOnly: true
    PersonLoan:
      description: >
        Represents a borrower attached to a loan. A borrower can be an
        applicant,

        main borrower, co-borrower, etc.
      properties:
        loanRelationType:
          $ref: '#/components/schemas/PersonType'
        object:
          default: personLoan
          enum:
            - personLoan
          readOnly: true
          type: string
        personId:
          $ref: '#/components/schemas/PersonId'
      type: object
    AmountsValidation:
      description: >
        This object contains information on whether the total of
        `expectedPayments` match to various amounts of the loan.
      properties:
        amountFinancedMatch:
          description: >
            `true` if the sum of `amountFinanced + originationFeeAmount` equals
            to `principalAmount`.

            We allow up to 1 cent difference in the match because of potential
            rounding issues. Only applicable if both

            `amountFinanced` and `principalAmount` are passed during
            origination; null otherwise.
        feesMatch:
          description: >
            `true` if the sum of `expectedPayments` fees portion is equal to
            `originationFeeAmount` + `totalOtherFeesAmount`. Only applicable

            when `expectedPayments` was passed during origination; `null`
            otherwise.
          nullable: true
          type: boolean
        interestMatch:
          description: >
            `true` if the sum of `expectedPayments` interest portion is equal to
            `totalInterestAmount`. We allow up 1 cent different in

            the match because of potential rounding issues. Only applicable when
            `expectedPayments` was passed during origination; `null`

            otherwise.
          nullable: true
          type: boolean
        principalMatch:
          description: >
            `true` if the sum of `expectedPayments` principal portion is equal
            to `amountFinanced`. We allow up 1 cent different in

            the match because of potential rounding issues. Only applicable when
            `expectedPayments` was passed during origination; `null`

            otherwise.
          nullable: true
          type: boolean
        recurringAmountsMatch:
          description: >
            `true` if `atOrigination.periodicPaymentAmount` (aka recurring
            amount) equals the first expected payment's recurring amount.

            Otherwise, `false`. `null` if `atOrigination.periodicPaymentAmount`
            or expected payments schedule is not passed at origination.
          nullable: true
          type: boolean
        totalAdvancesMatch:
          description: >
            `true` if the sum of `advanceSchedule` amounts is equal to
            `amountFinanced`. Only applicable when `advanceSchedule` was passed
            during

            origination; `null` otherwise.
          nullable: true
          type: boolean
      readOnly: true
      type: object
    ChargeDate:
      description: >
        **This attribute can be used only during the migration process of loans
        from another system to Peach. Any value passed for new loans

        that are created and activated from day zero (`nonMigrated` loans) on
        the Peach system will be ignored.**


        The effective date on which the fee was charged in the product timezone.
        In other words, this is when the fee was booked and written to the
        ledger.

        The charge date of the fee is different from the due date of the fee.
        The due date of the fee is `expectedPayments.date`. The `chargeDate`
        must be

        between the first and last dates (inclusive) of the period represented
        by `expectedPayments.date` (aka the due date).

        If the `chargeDate` is provided, you can also provide the
        `chargeTimeOfDay`.

        If the `chargeDate` is not provided, the system will charge the fee on
        the first day of the period.
      format: date
      type: string
    ExpectedPaymentsAtActivation:
      description: |
        Expected payments schedule for the loan at activation.
      items:
        description: The payment schedule at activation
        properties:
          amount:
            description: >
              The total amount of the payment. The total amount is equal to:
              `principalAmount` + `interestAmount`
            format: float
            type: number
          date:
            description: Due date.
            format: date
            type: string
          dynamicFeeDetails:
            description: >
              When `paymentType`=`dynamicFee` this will contain details of the
              dynamic fee.
            properties:
              chargeDate:
                $ref: '#/components/schemas/ChargeDate'
              chargeTimeOfDay:
                allOf:
                  - $ref: '#/components/schemas/TimeOfDay'
                  - description: >
                      See description of the `chargeDate`. The value can be
                      provided only if the `chargeDate` attribute is passed. If
                      `chargeTimeOfDay` is not provided,

                      the Peach system will determine and set the time of day.
                    type: object
              dynamicFeeTypeId:
                description: The dynamic fee type identifier in the system.
                nullable: true
                type: string
            type: object
          interestAmount:
            description: >
              The portion of `amount` allocated to interest (before any promo
              date(s) or discount). Required when `paymentType`

              is `periodicPayment`
            format: float
            type: number
          interestBeforeDiscountAmount:
            description: The amount of interest discount.
            format: float
            type: number
          isForcedAmount:
            default: false
            description: >
              Only applicable to `paymentType=periodicPayment`.

              If set to `true`, the system will honor the amount and will not
              update it on loan recalculations.

              If set to `false` and the amount is less than the
              `periodicPaymentAmount`, the system can increase the amount when

              the loan is being recalculated.

              In most of the cases, the lender should set the value to `false`
              (aka the default value.) If you need more

              explanation or advice on your use case, please contact the Peach
              team.
            type: boolean
          paymentType:
            description: The payment type.
            enum:
              - periodicPayment
              - originationFee
              - drawFee
              - dynamicFee
              - downPayment
              - discountCredit
            type: string
          principalAmount:
            description: >
              The portion of the `amount` allocated to principal. Required when
              `paymentType` is `periodicPayment`
            format: float
            type: number
          unroundedInterestAmount:
            description: >
              The portion of the `amount` allocated to net interest. Available
              only for `paymentType=periodicPayment`.

              This value is unrounded.
            nullable: true
            type: string
          unroundedInterestBeforeDiscountAmount:
            description: >
              The interest amount that was accrued before promo rate(s) or any
              discount. Available only for

              `paymentType=periodicPayment`. This value is unrounded.
            nullable: true
            type: string
          unroundedPrincipalAmount:
            description: >
              The portion of the `amount` allocated to principal. Available only
              for `paymentType=periodicPayment`.

              This value is unrounded.
            nullable: true
            type: string
        required:
          - date
          - paymentType
          - amount
        type: object
      nullable: true
      type: array
    ExpectedPaymentsAtOrigination:
      description: >
        Expected payments schedule for the loan at origination. The dates and
        amounts

        are exactly what a borrower agreed to and signed.
      items:
        description: The payment schedule at origination or draw
        properties:
          amount:
            description: >
              The total amount of the payment. The total amount is equal to:
              `principalAmount` + `interestAmount`
            format: float
            type: number
          date:
            description: Due date.
            format: date
            type: string
          dynamicFeeDetails:
            description: >
              When `paymentType`=`dynamicFee` this will contain details of the
              dynamic fee.
            properties:
              chargeDate:
                $ref: '#/components/schemas/ChargeDate'
              chargeTimeOfDay:
                allOf:
                  - $ref: '#/components/schemas/TimeOfDay'
                  - description: >
                      See description of the `chargeDate`. The value can be
                      provided only if the `chargeDate` attribute is passed. If
                      `chargeTimeOfDay` is not provided,

                      the Peach system will determine and set the time of day.
                    type: object
              dynamicFeeTypeId:
                description: The dynamic fee type identifier in the system.
                nullable: true
                type: string
            type: object
          interestAmount:
            description: >
              The portion of `amount` allocated to interest (before any promo
              date(s) or discount). Required when `paymentType`

              is `periodicPayment`
            format: float
            type: number
          interestBeforeDiscountAmount:
            description: The amount of interest discount.
            format: float
            type: number
          isForcedAmount:
            default: false
            description: >
              Only applicable to `paymentType=periodicPayment`.

              If set to `true`, the system will honor the amount and will not
              update it on loan recalculations.

              If set to `false` and the amount is less than the
              `periodicPaymentAmount`, the system can increase the amount when

              the loan is being recalculated.

              In most of the cases, the lender should set the value to `false`
              (aka the default value.) If you need more

              explanation or advice on your use case, please contact the Peach
              team.
            type: boolean
          paymentType:
            description: The payment type.
            enum:
              - periodicPayment
              - originationFee
              - drawFee
              - dynamicFee
              - downPayment
              - discountCredit
            type: string
          principalAmount:
            description: >
              The portion of the `amount` allocated to principal. Required when
              `paymentType` is `periodicPayment`
            format: float
            type: number
          unroundedInterestAmount:
            description: >
              The portion of the `amount` allocated to net interest. Available
              only for `paymentType=periodicPayment`.

              This value is unrounded.
            nullable: true
            type: string
          unroundedInterestBeforeDiscountAmount:
            description: >
              The interest amount that was accrued before promo rate(s) or any
              discount. Available only for

              `paymentType=periodicPayment`. This value is unrounded.
            nullable: true
            type: string
          unroundedPrincipalAmount:
            description: >
              The portion of the `amount` allocated to principal. Available only
              for `paymentType=periodicPayment`.

              This value is unrounded.
            nullable: true
            type: string
        required:
          - date
          - paymentType
          - amount
        type: object
      nullable: true
      type: array
    LoanInvestor:
      properties:
        investorId:
          description: The Investor's unique identifier, internal or lender's external.
          type: string
        metro2:
          properties:
            reportK2Segment:
              default: false
              description: >
                Only applicable to loans that are reported to credit bureaus.


                If `true`, the system will report the K2 segment in the Metro2
                file

                to indicate that the loan has been sold to a new investor. Peach

                will continue to report the loan.


                If `false`, the system will not report the K2 segment in the
                Metro2

                file. Peach will continue to report the loan.
              nullable: false
              type: boolean
          type: object
        share:
          description: >
            The ownership percentage of the loan. The format is decimal. For
            example, 0.01 is 1% ownership and 0.15 is 15% ownership.
          format: float
          type: number
      required:
        - investorId
        - share
      title: Loan Investor Association
      type: object
    LoanInvestorGet:
      allOf:
        - $ref: '#/components/schemas/LoanInvestor'
        - properties:
            effectiveDate:
              description: The date at which this ownership structure came into effect.
              format: date
              type: string
          type: object
    LoanInvestorsGet:
      items:
        $ref: '#/components/schemas/LoanInvestorGet'
      type: array
    MerchantDiscountRateObj:
      description: >
        This object represents optional configurations for the MDR (Merchant
        Discount Rate). When POS (point of sale)

        lenders issue loans, the merchant pays some percentage of the financed
        amount - called the MDR.
      nullable: true
      properties:
        amortizationPeriod:
          description: >
            Number of calendar days. If a value is passed, the system will
            amortize the `mdrAmount` over the `amortizationPeriod`

            number of calendar days.


            If a value is not passed or the value exceeds the loan life, the
            system will amortize the MDR amount over the life of

            the loan. For Line of Credit, it is required to provide the
            `amortizationPeriod`. For Installment loans, it is

            recommended to leave the value empty.
          nullable: true
          type: number
        isAmortized:
          default: true
          description: >
            `true` to amortize the `mdrAmount` using the straight-line
            amortization method over the life of the loan.

            `false` to recognize the `mdrAmount` as revenue in full on the day
            when the loan is activated.
          nullable: true
          type: boolean
        mdrAmount:
          description: The Merchant Discount Amount.
          format: float
          nullable: true
          type: number
      type: object
    MerchantDiscountRateObjWithRate:
      allOf:
        - properties:
            mdrRate:
              description: >
                The Merchant Discount Rate (MDR). The format is decimal. For
                example, 0.03 is a 3% annual rate, 0.2 is a

                20% annual rate. If `mdrAmount` is not passed, the system will
                calculate the `mdrAmount` by multiplying

                the `amountFinanced` by the `mdrRate`.
              format: float
              nullable: true
              type: number
          type: object
        - $ref: '#/components/schemas/MerchantDiscountRateObj'
    LoanOriginationLicense:
      description: The license that was used to originate the loan.
      enum:
        - nationalBank
        - stateLicense
        - bankSubsidiary
        - stateBank
      type: string
    RateCapMaxRate:
      description: >
        The maximum spread interest rate that can accrue. 


        If the calculated rate on a given day is greater than `maxRate`, then
        the system will

        cap the rate and accrue a maximum of `maxRate` on the loan. Else, we
        will use the calculated rate. 


        Format is decimal. For example, 0.36 is 36% annual rate cap.
      format: float
      minimum: 0
      type: number
    RateCapReason:
      default: other
      description: >
        The reason for `maxRate`. This is not used for any compliance logic,
        only for informational purposes. 


        - `MLA` - Military Lending Act (36% cap for active duty military)

        - `SCRA` - Servicemembers Civil Relief Act

        - `federal` - Other federal regulations

        - `state` - State-specific regulations

        - `other` - Other regulatory or business reasons
      enum:
        - MLA
        - SCRA
        - federal
        - state
        - other
      type: string
    RateCapAtOrigination:
      description: >
        A rate cap definition for loan origination. Uses days-based duration
        instead of specific dates.

        Rate caps prevent calculated rates (spread + index) from exceeding
        regulatory limits.

        When multiple rate caps overlap, the system uses the lowest value.
      properties:
        days:
          description: >
            Number of calendar days the rate cap applies from loan origination. 

            If null, the rate cap applies for the entire loan term.


            For example:


            ```

            [{"days": 30, "maxRate": 0.1},

            {"days": 60, "maxRate": 0.2},

            {"days": null, "maxRate": 0.25}]

            ```


            The loan will accrue interest with a rate cap of 10% for the first
            30 days. 

            Between days 31-90 the loan will accrue interest with a rate cap of
            20%. 

            From day 91 until the end, the loan will accrue interest with a rate
            cap of 25%.
          nullable: true
          type: number
        maxRate:
          $ref: '#/components/schemas/RateCapMaxRate'
        rateCapReason:
          $ref: '#/components/schemas/RateCapReason'
      required:
        - maxRate
        - days
        - rateCapReason
      title: Rate Cap At Origination
      type: object
    RateCapsAtOriginationLoan:
      description: >
        Rate caps that should apply to the loan at origination. 


        When the loan is created these rate caps are created and 

        applied to the loan. They will be accessible via the `.../rate-caps`
        endpoint.
      items:
        $ref: '#/components/schemas/RateCapAtOrigination'
      nullable: true
      title: Rate Caps At Origination
      type: array
    InstallmentAtOrigination:
      description: >-
        This object contains loan details and terms as they were shown to a
        borrower at origination.
      properties:
        advanceSchedule:
          $ref: '#/components/schemas/AdvanceSchedule'
        amortizationMethod:
          description: >
            Loan amortization method.


            `equalPayments` - the system will amortize the loan or draw making
            recurring payments equal (except maybe for the last payment).

            Most installment loans are expected to use this method.


            `interestPaymentsBalloonPrincipal` - the system will amortize the
            loan or draw making recurring payments equal to interest only

            and the last payment will include the entire principal. Keep in mind
            that if you set `interest.periodAccrualDurationType=actual`,

            the recurring payment amounts will be different every period for
            monthly and twice monthly frequencies. This is because a month

            can have 28, 29, 30 or 31 days and interest accrued will vary based
            on the number of days in the month.


            There are additional limitations to be aware for
            `interestPaymentsBalloonPrincipal`. For installment loans, Autopay
            can only be

            aligned to due dates. It means that
            `autoPay.allowedFrequency.isDueDatesAvailable` must be set to
            `false`. This way the system

            will only allow Autopay to be aligned to the loan frequency and due
            dates.
          enum:
            - equalPayments
            - interestPaymentsBalloonPrincipal
            - custom
          readOnly: true
          type: string
        amountFinanced:
          description: >
            The amount financed. The amount of money a borrower received from
            the lender, minus the upfront fees (e.g. origination fee) the lender
            is charging the borrower.
          format: float
          type: number
        aprEffective:
          description: >
            The effective APR of the loan at origination. Pass both `aprNominal`
            and `aprEffective` even if they are equal.
          format: float
          nullable: true
          type: number
        aprNominal:
          description: >
            The nominal APR of the loan at origination. Pass both `aprNominal`
            and `aprEffective` even if they are equal.
          format: float
          nullable: true
          type: number
        bufferToPushOutSchedule:
          $ref: '#/components/schemas/BufferToPushOutSchedule'
        discountProgramIds:
          description: >
            The identifiers of the discount programs provided at origination. A
            discount program

            has to be created before it can be applied to loans.
          items:
            type: integer
          nullable: true
          type: array
        downPaymentAmount:
          description: >
            The amount of down payment made when the loan was originated. The
            value should be equal to what a

            borrower agreed to and signed at origination.
          format: float
          type: number
        duration:
          description: >
            The duration of the loan as a number of `paymentFrequency` periods.

            For example:

            - if `paymentFrequency=monthly` and `duration=6`, it is a loan with
            6 months duration and will have 6 due dates.

            - if `paymentFrequency=weekly` and `duration=24`, it is a loan with
            24 weeks duration and will have 24 due dates.
          type: number
        enforcedEndDate:
          description: >
            The enforced end date of the loan in the product timezone. If the
            `enforcedEndDate` is not provided, it will be set at `activation`.

            If `enforcedEndDate` and `expectedPayments` are provided, the last

            payment due date MUST match `enforcedEndDate`.
          format: date
          nullable: true
          type: string
        expectedPayments:
          $ref: '#/components/schemas/ExpectedPaymentsAtOrigination'
        fees:
          description: The loan fees.
          properties:
            dynamicFees:
              $ref: '#/components/schemas/AtOriginationDynamicFees'
            originationFeeAmount:
              description: The amount of the origination fee.
              format: float
              nullable: true
              type: number
            serviceFeeAmount:
              description: >
                **DEPRECATED ATTRIBUTE** Use `dynamicFees.feeAmount`.


                The service fee amount that will be charged recurrently. Only
                required if the service fee `amountLogic` is configured as

                `type=passedAtOrigination`. In all other cases, the system will
                calculate the fee based on pre-configured logic.
              format: float
              type: number
            serviceFeeCapAmount:
              description: >
                **DEPRECATED ATTRIBUTE** Use `dynamicFees.feeCapAmount`.


                The maximum amount of the service fee that can be charged over
                the life of the loan or draw. Only required if the service fee

                `capLogic` is configured as `type=capPassedAtOrigination`. In
                all other cases, the system will calculate the fee based on
                pre-configured

                logic.
              format: float
              type: number
            totalOtherFeesAmount:
              description: >
                The total amount of non-origination fees that are expected to be
                charged on the loan. The value should be

                equal to what a borrower agreed to and signed at origination.
              format: float
              nullable: true
              type: number
          type: object
        interestRates:
          $ref: '#/components/schemas/LoanInterestRatesAtOrigination'
        investors:
          allOf:
            - $ref: '#/components/schemas/LoanInvestorsGet'
          description: >
            A list of the investors who owned the loan at origination.

            If none are provided, it defaults to the default investor configured
            for the lender.
        isValidMerchantId:
          description: >
            `true` - if the merchant ID exists in Peach Merchants table.


            `false` - if the merchant ID doesn't exist in Peach Merchants table.

            Credit card lenders normally should not create merchants details in
            Peach and `isMerchantIdValid` attribute can be ignored.

            Point of sale lenders normally have merchants details in Peach and
            can use `isMerchantIdValid` attribute as needed.
          readOnly: true
          type: boolean
        itemsOrServicesFinanced:
          description: >
            Merchandise, services or other value provided in exchange for the
            debt. For example: refrigerator

            or kitchen renovation. This description is used in communications
            with the borrower, when needed.
          nullable: true
          type: string
        mdr:
          $ref: '#/components/schemas/MerchantDiscountRateObjWithRate'
        merchantId:
          description: |
            A lender's identifier for the merchant.
          nullable: true
          type: string
        originatingCreditorName:
          description: >
            The name of an entity that originated the loan. For example: Bank of
            Mars. This name will be

            used in communications with the borrower when needed.
          type: string
        originationLicense:
          $ref: '#/components/schemas/LoanOriginationLicense'
        paymentFrequency:
          description: >
            The payment frequency of the loan.


            `weekly`, `everyTwoWeeks`, `twiceMonthly`, `monthly` - are
            recurring.


            `singleTerm` - a single term loan (aka non-recurring). It will
            create one period only with a desired "duration" of 30,

            60, 90, 120, X calendar days or a specific date that should be
            passed in specificDays. For example [90].
          enum:
            - weekly
            - everyTwoWeeks
            - twiceMonthly
            - monthly
            - singleTerm
          type: string
        periodicPaymentAmount:
          description: >
            The amortized periodic payment amount excluding fees. Keep in mind
            that the last payment

            can be different from the `periodicPaymentAmount`. Required when
            passing in `expectedPayments`

            at origination.
          format: float
          nullable: true
          type: number
        personAddress:
          $ref: '#/components/schemas/Address'
        personAddressId:
          description: >
            This is the existing identifier of a borrower's address contact
            information (Peach's

            unique or lender's external identifier). If passed during
            origination, the address will be stored

            on the loan object as a reference. Alternatively, the address can be
            directly provided

            in `personAddress`, in which case, `personAddressId` should not be
            sent.
          pattern: ^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$
          type: string
          writeOnly: true
        principalAmount:
          description: >
            The amount of principal at origination. Lenders should only pass
            this value if `principalAmount` is different from `amountFinanced`.

            If a value is provided, the system will use `principalAmount` as the
            loan principal for interest calculations and amortization. The value
            should be greater than `amountFinanced`.

            If a value is not provided, the system will:

            - Set `principalAmount = amountFinanced`.

            - Use `amountFinanced` as the loan principal for interest
            calculations and amortization.
          format: float
          nullable: true
          type: number
        promoRates:
          $ref: '#/components/schemas/LoanPromoRatesAtOrigination'
          nullable: true
        rateCaps:
          $ref: '#/components/schemas/RateCapsAtOriginationLoan'
        skipCreditReporting:
          default: false
          description: >
            Set to `true` if the loan should not be reported to the credit
            agencies when activated.
          type: boolean
        specificDays:
          $ref: '#/components/schemas/SpecificDays'
        totalDiscountAmount:
          description: >
            The total amount of discount at origination as a result of promo
            rates. The value should be equal to what

            a borrower agreed to and signed at origination.
          format: float
          type: number
        totalInterestAmount:
          description: >
            The total amount of interest the loan should accrue. The value
            should be equal to what a borrower agreed

            to and signed at origination. Because of rounding issues, the total
            of expected payments `interestAmount`

            might be different from `totalInterestAmount`.
          format: float
          type: number
        totalInterestCapAmount:
          description: |
            The maximum amount of interest the borrower will ever pay.
            If not applicable, set to `null`.
          format: float
          nullable: true
          type: number
        validAddress:
          default: false
          description: Identifies the address at origination as valid or invalid.
          readOnly: true
          type: boolean
      title: Installment
      type: object
    PromoEndDate:
      description: |
        The promotional program end-date without a potential grace
        period.
        If `promoEndDate` is passed, the system will calculate the
        `promoDurationDays`.
        Pass only one of the attributes, `promoEndDate` or
        `promoDurationDays`.

        This date field should be in the product timezone.
      format: date
      type: string
    PromoGracePeriodDays:
      description: |
        The promotional program grace period as a number of calendar days.
        Grace period allows the borrower to exercise the promotional program
        for an additional number of days after it expires.

        If you don't pass a value, the system will assume zero (aka no grace
        period).
      type: integer
    PromoStartDate:
      description: "The `promoStartDate` date marks the start date from which a\npromotional program is valid and will be evaluated to be exercised.\nWhen a promo program is created with `promoDurationDays` specified,\nthe `promoStartDate` is also used to calculate the `promoEndDate`.\_\n\nFor installment loans:\n\n- The `promoStartDate` can be a date in the future but not after the\n  loan's last due date.\n  The promotion is valid and evaluated after it has been activated\n  and the `promoStartDate` arrived.\n- The `promoStartDate` can be a date in the past but not before the\n  loan's activation date.\n- The `promoStartDate` is optional.\n  If the value is not passed, the system will set the promoStartDate\n  to the loan activation date.\n- For `Same as Cash` promo programs, the waiving of interest benefit\n  will be added from the loan activation date for the entire life of\n  the loan for installment loans, regardless of the\n  `promoStartDate`.\n\nFor Line of Credit draws:\n\n- The `promoStartDate` can be a date in the future.\n  The promotion is valid and evaluated after it has been activated\n  and the `promoStartDate` arrived.\n- The `promoStartDate` cannot be a date in the past.\n\nIf a value is not passed, the system will set the `promoStartDate`\nto be the date of the activation.\n\nThis date value should be in the product timezone.\n"
      format: date
      type: string
    PromoProgramFields:
      properties:
        disqualifyOverdueDays:
          description: |
            The number of loan overdue days that would disqualify the
            promotional program.
            Any occurrence of `disqualifyOverdueDays` or more of number
            days overdue during the promotional period would disqualify
            (aka cancel) the promotional program.
          type: integer
        externalId:
          description: |
            A lender's unique identifier for a specific promotional
            program.
          type: string
        metaData:
          description: |
            Store any type of key/value pairs in the form of a JSON
            dictionary.
          nullable: true
          type: object
        promoDurationDays:
          description: |
            The promotional program duration as a number of calendar
            days.
            If `promoDurationDays` is passed, the system will calculate
            the `promoEndDate`.
            Pass only one of the attributes, `promoEndDate` or
            `promoDurationDays`.
          type: integer
        promoEndDate:
          $ref: '#/components/schemas/PromoEndDate'
        promoGracePeriodDays:
          $ref: '#/components/schemas/PromoGracePeriodDays'
        promoStartDate:
          $ref: '#/components/schemas/PromoStartDate'
        promoTypeId:
          description: The promotional program type's unique identifier.
          type: string
        status:
          description: |
            The promotional program status.

              `pending` - the promotion was created but was not activated yet.

              `active` - the promotion is active.

            For promo program creation, `installment` loans can be
            created in either `pending` or `active` status. 

            For line of credit / draws, a promo program can only be
            created in `pending` status and transitioned to `active`
            status via the promo program activate endpoint.
          enum:
            - pending
            - active
          type: string
      type: object
    PromoProgramCreate:
      allOf:
        - required:
            - promoTypeId
            - status
        - $ref: '#/components/schemas/PromoProgramFields'
        - properties:
            id:
              description: The promotional program's unique identifier.
              readOnly: true
              type: string
          type: object
      description: Create a promo program
    PromoProgramAtOrigination:
      properties:
        promoPrograms:
          description: The list of promotional programs that the loan is eligible for.
          items:
            $ref: '#/components/schemas/PromoProgramCreate'
          nullable: true
          type: array
      type: object
    InterestRateValidation:
      properties:
        interestRateAtOrigBelowMin:
          description: >
            `true` if the interest rate at origination is below the minimum
            interest rate.
          type: boolean
        interestRateAtOrigExceedsMax:
          description: >
            `true` if the interest rate at origination exceeds the maximum
            interest rate.
          type: boolean
      type: object
    AprValidation:
      properties:
        aprEffectiveAtActExceedsMax:
          description: |
            `true` if the effective APR at activation exceeds the maximum APR.
          type: boolean
        aprEffectiveAtOrigExceedsMax:
          description: |
            `true` if the effective APR at origination exceeds the maximum APR.
          type: boolean
        aprNominalAtActExceedsMax:
          description: |
            `true` if the nominal APR at activation exceeds the maximum APR.
          type: boolean
        aprNominalAtOrigExceedsMax:
          description: |
            `true` if the nominal APR at origination exceeds the maximum APR.
          type: boolean
      type: object
    RatesValidation:
      allOf:
        - $ref: '#/components/schemas/InterestRateValidation'
        - $ref: '#/components/schemas/AprValidation'
      description: >-
        This object contains information on whether actual rates exceed the rate
        ranges defined on the loan type.
      readOnly: true
    LoanServicer:
      description: >
        The entity type that services the loan.


        `creditor`, `thirdPartyServicer` - means that the loan is serviced on
        the Peach platform.


        `debtCollectionAgency` - means that the loan is no longer serviced on
        the Peach platform. The loan can be still visible in Borrower Portal. To
        clarify, the loan is not deleted from the Peach platform.
      enum:
        - creditor
        - thirdPartyServicer
        - debtCollectionAgency
      type: string
    LoanStatus:
      description: >
        The current status of the loan. New loans must be created in `pending`,
        `originated` or `declined` status.


        `pending` - the loan is in the application stage. Loan `atOrigination`
        details and terms can be changed (via API).


        `originated` - the loan was signed by the borrower and originated by the
        lender. Loan `atOrigination` details cannot be changed. Originated loans
        do not start accruing interest until activated.


        `declined` - an application was declined. This is a terminal state.


        `active` - the loan is active. Most loans are expected to be active.


        `frozen` - the loan is temporarily frozen. The loan will not accrue any
        interest, no payments can be processed, and no notifications are sent to
        the borrower.


        `accelerated` - the loan was accelerated. The loan will not accrue any
        additional interest and the entire balance is due.


        `chargedOff` - the loan was charged off.


        `paidOff` - the loan was successfully paid off.


        `canceled` - the loan was canceled. Canceled loans are not shown in UI.
        This is a terminal state.
      enum:
        - pending
        - originated
        - declined
        - active
        - frozen
        - accelerated
        - chargedOff
        - paidOff
        - canceled
      type: string
    Installment:
      allOf:
        - $ref: '#/components/schemas/BaseMixinWithoutTimestamps'
        - properties:
            loanTypeId:
              description: >
                The loan type identifier. This is created specifically for each
                lender's loan product by Peach.
              type: string
          type: object
        - $ref: '#/components/schemas/BaseLoanMixin'
        - $ref: '#/components/schemas/SharedInstallmentAndLoc'
        - properties:
            additionalPeople:
              description: >
                For loans with multiple people attached, use this field to add
                additional people.

                You do not need to include the main borrower, who will be
                created from the url parameter.
              items:
                $ref: '#/components/schemas/PersonLoan'
              type: array
              writeOnly: true
            amountsValidation:
              $ref: '#/components/schemas/AmountsValidation'
            aprEffectiveAtActivation:
              description: >
                The APR that was calculated by Peach at loan activation. The
                format is decimal. For

                example, 0.01 is 1%, 0.2 is 20%. If the origination and
                activation dates are the same,

                the `aprEffective` is equal to the `aprEffectiveAtActivation`.

                If the origination and activation dates are different, the

                `aprEffective` might be different from the
                `aprEffectiveAtActivation`. `aprEffective` is

                `null` if it could not be computed.
              format: float
              nullable: true
              readOnly: true
              type: number
            aprNominalAtActivation:
              description: >
                The APR that was calculated by Peach at loan activation. The
                format is decimal. For

                example, 0.01 is 1%, 0.2 is 20%. If the origination and
                activation dates are the same,

                the `aprNominal` is equal to the `aprNominalAtActivation`.

                If the origination and activation dates are different, the

                `aprNominal` might be different from the
                `aprNominalAtActivation`.`aprEffective` is

                `null` if it could not be computed.
              format: float
              nullable: true
              readOnly: true
              type: number
            atActivation:
              description: >-
                This object contains loan details and terms at the time of loan
                activation.
              properties:
                expectedPayments:
                  $ref: '#/components/schemas/ExpectedPaymentsAtActivation'
              readOnly: true
              title: Installment
              type: object
            atOrigination:
              allOf:
                - $ref: '#/components/schemas/InstallmentAtOrigination'
                - $ref: '#/components/schemas/PromoProgramAtOrigination'
            current:
              allOf:
                - properties:
                    autopayEnabled:
                      description: |
                        Whether Autopay is enabled for this loan.
                      type: boolean
                    duration:
                      $ref: '#/components/schemas/LoanDuration'
                    paymentFrequency:
                      $ref: '#/components/schemas/InstallmentPaymentFrequency'
                    periodicPayment:
                      description: >
                        The most recent amortized periodic payment that was
                        calculated on `lastAmortizedAt`.
                      format: float
                      type: number
                    specificDays:
                      $ref: '#/components/schemas/SpecificDays'
                  type: object
              description: >-
                This object contains some loan details that were modified after
                origination.
              readOnly: true
            isClosed:
              description: >
                Indicates whether the loan with multiple advances is closed. If
                `true` and the loan type installment with multiple advances, new
                Advances

                cannot be created, and the advance schedule cannot be updated.
              type: boolean
            muteLoanNotices:
              description: >
                Indicates whether the system should stop/pause sending loan
                related notices to the borrower. Set to true if you want to mute
                all loan related notices (e.g. loanDetails. autopayEnabled,
                paymentFailed, etc.) Keep in mind that it will also stop all
                notices related to the loan that are sent from Peach Agent
                Portal by an agent.

                Note: this is not the only attribute that can stop notices from
                being sent. Compliance Guard and Cases Do Not Interact can also
                block communications.
              type: boolean
            nickname:
              description: >
                The loan's nickname. Nickname is a friendly name of the loan and
                is displayed in the UI.

                Nickname is different from loan ID. Nickname can be changed by a
                borrower.
              nullable: true
              type: string
            object:
              enum:
                - installment
              readOnly: true
              type: string
            ratesValidation:
              $ref: '#/components/schemas/RatesValidation'
            servicedBy:
              $ref: '#/components/schemas/LoanServicer'
            status:
              $ref: '#/components/schemas/LoanStatus'
            type:
              enum:
                - installment
              type: string
          type: object
      title: Installment
    LOCMinPaymentCalculation:
      description: >
        The logic to calculate the minimum payment amount when a statement is
        created. All interest accrued in the period and fees are always part

        of the minimum payment amount plus a `percentageOfPrincipal` for each
        draw.


        If `includeOverLimitAmount` is set to true at the draw level, the
        minimum payment amount will include the over limit amount at the time of

        statement generation as part of the required minimum payment for each
        draw. The overlimit amount will be distributed/allocated according to

        the `paymentWaterfall.multi.loansOrder` configuration at the loanType
        level (e.g. `highestInterestRate`).


        Statement logic adds up all draws calculated minimum payment amounts
        (including overlimit amounts, if applicable) and adds all unpaid fees

        to set the total statement minimum amount. If the `loanType.statement`
        object is configured such that `includeOverdueAmountInMinPayment=true`,

        the statement minimum payment amount will include the overdue amount as
        part of the required minimum payment displayed on the statement.
      properties:
        minAmount:
          description: >
            The minimum periodic amount. For example: $35.00. The minimum will
            be only enforced if draws on the line of credit do not have an
            amortized amount.


            Example:

            Assume `minAmount` on the loan-level is set to $35.00.

            Draw 1 outstanding principal is $100.00.

            Draw 1 percentageOfPrincipal=0.01 (aka 1%).

            Draw 1 interest rate is 2% per month.

            Draw 1 interest amount per month is: $100.00 * 2% = $2.00.

            Draw 1 minimum amount is: $2 + $100.00 * 1% = $3.00.


            Draw 2 outstanding principal is $200.00.

            Draw 2 percentageOfPrincipal=0.02 (aka 2%).

            Draw 2 interest rate is 3% per month.

            Draw 2 interest amount per month is: $200.00 * 3% = $6.00.

            Draw 2 minimum amount is: $6 + $200.00 * 1% = $8.00.


            Loan level fees: Fee 1 is $5.00, Fee 2 is $7.50. Both are unpaid.


            Loan-level minimum payment calculation is max($35.00, [$3.00 (draw 1
            minimum) + $8.00 (draw 2 minimum) + $5.00 (fee 1) + $7.50 (fee 2)])
            = max($35, $23.50) = $35

            The minimum payment will be set to $35.00 and not $23.50. The split
            between principal, interest, and fees will be fees=$12.50,
            interest=$8.00 and principal=$14.50.

            Principal will be allocated first according to the
            `percentageOfPrincipal` on each draw (e.g., $1 for draw 1 and $2 for
            draw 2 in the example above). The remaining

            principal amount ($11.50 in the example) will be allocated to draws
            based on the `loansOrder` as part of the `multi` waterfall
            configuration at the loanType level.

            In the example above, assuming draw 1 is ordered before draw 2, the
            $11.50 will be allocated to draw 1. Draw 1 minimum amount will
            increase to ($3.00 + $11.50) = $14.50.
          format: float
          type: number
      type: object
    LineOfCreditAtOrigination:
      description: >-
        This object contains loan details and terms as they were shown to a
        borrower at origination.
      properties:
        aprEffective:
          description: >
            **DEPRECATED ATTRIBUTE**


            The effective APR of the loan at origination. Pass both `aprNominal`
            and `aprEffective` even if they are equal.


            This field is deprecated for Line of Credit and Draw. You can still
            pass the value, and it will be stored on the object.

            However, it will not be used/displayed anywhere. The system will use
            the interest rate values of Line of Credit and Draws

            and show them as the APR (for example, on the statement.)
          format: float
          nullable: true
          type: number
        aprNominal:
          description: >
            **DEPRECATED ATTRIBUTE**


            The nominal APR of the loan at origination. Pass both `aprNominal`
            and `aprEffective` even if they are equal.


            This field is deprecated for Line of Credit and Draw. You can still
            pass the value, and it will be stored on the object.

            However, it will not be used/displayed anywhere. The system will use
            the interest rate values of Line of Credit and Draws

            and show them as the APR (for example, on the statement.)
          format: float
          nullable: true
          type: number
        aprVariableRange:
          description: >
            The APR range if the loan has variable APR/interest rate. If the
            loan has a fixed APR/interest rate, keep this attribute empty.


            This attribute is only used to be displayed on emails, Borrower
            Portal, statements and other UI elements. If `aprVariableRange` is

            passed, the statement will show `(v) = Variable Rate` next to the
            APR values. The range should not change after the loan was
            originated.

            The interest rate (also called the current effective APR) can change
            using Loans Management Rates endpoints. Keep in mind that this range

            is applicable to all Draws. Draw object doesn't have its own
            aprVariableRange attribute.


            The format is decimal up to 4 decimal places. First value is minimum
            rate (inclusive). Second value is maximum rate (inclusive).


            For example:
              - [0.1999, 0.2999] - is 19.99% - 29.99% APR.
              - [0.01, 0.03] - is 1.00% - 3.00% APR.
          example:
            - 0.1999
            - 0.2999
          items:
            format: float
            type: number
          maxItems: 2
          minItems: 2
          nullable: true
          type: array
        bufferToPushOutSchedule:
          $ref: '#/components/schemas/BufferToPushOutSchedule'
        creditLimitAmount:
          description: The credit limit amount.
          format: float
          type: number
        discountProgramIds:
          items:
            description: >
              The identifiers of the discount programs provided at origination.
              A discount program

              has to be created before it can be applied to loans.
            type: integer
          nullable: true
          type: array
        downPaymentAmount:
          description: The amount of down payment made when the loan was originated.
          format: float
          type: number
        fees:
          description: The loan fees.
          properties:
            dynamicFees:
              $ref: '#/components/schemas/AtOriginationDynamicFees'
            originationFeeAmount:
              description: The amount of the origination fee.
              format: float
              nullable: true
              type: number
            serviceFeeAmount:
              description: >
                **DEPRECATED ATTRIBUTE** Use `dynamicFees.feeAmount`.


                The service fee amount that will be charged recurrently. Only
                required if the service fee `amountLogic` is configured as

                `type=passedAtOrigination`. In all other cases, the system will
                calculate the fee based on pre-configured logic.
              format: float
              type: number
            serviceFeeCapAmount:
              description: >
                **DEPRECATED ATTRIBUTE** Use `dynamicFees.feeCapAmount`.


                The maximum amount of the service fee that can be charged over
                the life of the loan or draw. Only required if the service fee

                `capLogic` is configured as `type=capPassedAtOrigination`. In
                all other cases, the system will calculate the fee based on
                pre-configured

                logic.
              format: float
              type: number
          type: object
        gracePeriod:
          description: >
            The logic to handle grace period benefit. The grace period benefit
            allows the borrower to not accrue any interest on line/draws

            as long as they pay the required balance every period.


            The grace period benefit can work in two ways in Peach:

            1. Line level - in this case, the loan/line and all draws must meet
            the grace period repayment requirement. If one of the draws

            didn't meet the repayment requirement (in other words the entire
            line didn't meet the repayment requirement), all applicable/enrolled

            draws would lose the grace period benefit and accrue interest.

            2. Draw level - in this case each applicable/enrolled draw needs to
            meet its own grace period repayment requirements. If one of the

            applicable/enrolled draws didn't meet the repayment requirements,
            other draws might still be eligible for the grace period benefit

            (as long as they meet their own requirements).


            Line level configuration:

            - You need to pass the `gracePeriod` object with
            `isGracePeriodApplicable=true` and other attributes when you create
            the line/loan.

            - You need to pass a draw-level `gracePeriod` object. Please read
            more details about the `gracePeriod` object in the `Create draw`

            endpoint. If the loan/line `isGracePeriodApplicable=true`, all draws
            of the line participate in the evaluation of the loan/line grace

            period benefit eligibility. But not all draws have to receive the
            grace period benefit - you can decide what draws should accrue
            interest

            even if the line is eligible for the benefit.  For example,
            amortized draws can participate in the grace period benefit
            eligibility, but

            are not designed to be eligible for grace period benefit (in other
            words, amortized draws are expected to accrue interest if an
            interest

            rate greater than zero was set on the draw).


            Draw level configuration:

            - Don't pass the `gracePeriod` object or set
            `isGracePeriodApplicable=false` when you create the line/loan.

            - You can enroll applicable draws in the grace period benefit by
            passing draw-level `gracePeriod` object. Please read more details
            about

            the `gracePeriod` object in the `Create draw` endpoint.


            Important: the grace period attributes cannot be changed after the
            line is activated.
          properties:
            isGracePeriodApplicable:
              default: false
              description: >
                The type of the grace period benefit.


                `true` -  the grace period benefit is on the loan/line level.

                - The loan/line and all draws must meet the grace period
                repayment requirement. If one of the draws didn't meet the
                repayment requirement

                (in other words the entire line didn't meet the repayment
                requirement), all draws eligible for the grace period benefit
                would lose the

                grace period benefit and accrue interest.

                - You need to pass details of how draws are evaluated in the
                grace period benefit - read more details about the `gracePeriod`
                object in

                the `Create draw` endpoint.


                `false` - the grace period benefit can be set on a draw level.

                - Each applicable draw needs to meet its own grace period
                repayment requirements. If one of the applicable draws didn't
                meet the repayment

                requirements, other draws might still be eligible for the grace
                period benefit (as long as they meet their own requirements).

                - You can enroll individual draws in the grace period benefit -
                read more details about the `gracePeriod` object in the `Create
                draw`

                endpoint. If the grace period benefit is not applicable to your
                program, don't enroll in any draws.
              type: boolean
            numPeriodsToRestoreGrace:
              default: 1
              description: >
                Number of periods to wait after the grace period benefit was
                revoked before the line/loan can become eligible again.

                To take advantage of the grace period, the borrower must pay
                their account balance according to the grace period benefit
                requirements on time for the number of billing periods provided.


                If this attribute is passed, it will be used to set the
                draw-level `numPeriodsToRestoreGrace` for any draw that is
                enrolled in the grace period benefit (aka
                `isGracePeriodApplicable=true`).

                This will ensure that the line and all draws have the same
                `numPeriodsToRestoreGrace` values.


                This attribute is required to be passed if
                `isGracePeriodApplicable=true` and must be greater than zero.

                This attribute is not required and won't be used if the
                `gracePeriod` object is not passed or
                `isGracePeriodApplicable=false`.
              minimum: 1
              type: integer
          type: object
        interestRates:
          $ref: '#/components/schemas/LoanInterestRatesAtOrigination'
        investors:
          allOf:
            - $ref: '#/components/schemas/LoanInvestorsGet'
          description: >
            A list of the investors who owned the loan at origination.

            If none are provided, it defaults to the default investor configured
            for the lender.
        isValidMerchantId:
          description: >
            `true` - if the merchant ID exists in Peach Merchants table.


            `false` - if the merchant ID doesn't exist in Peach Merchants table.

            Credit card lenders normally should not create merchants details in
            Peach and `isMerchantIdValid` attribute can be ignored.

            Point of sale lenders normally have merchants details in Peach and
            can use `isMerchantIdValid` attribute as needed.
          readOnly: true
          type: boolean
        itemsOrServicesFinanced:
          description: >
            Merchandise, services or other value provided in exchange for the
            debt. For example: refrigerator

            or kitchen renovation. This description is used in communications
            with the borrower, when needed.
          nullable: true
          type: string
        merchantId:
          description: |
            A lender's identifier for the merchant.
          nullable: true
          type: string
        minPaymentCalculation:
          $ref: '#/components/schemas/LOCMinPaymentCalculation'
        originatingCreditorName:
          description: >
            The name of an entity that originated the loan. For example: Bank of
            Mars. This name will be

            used in communications with the borrower when needed.
          type: string
        originationLicense:
          $ref: '#/components/schemas/LoanOriginationLicense'
        paymentFrequency:
          enum:
            - weekly
            - everyTwoWeeks
            - twiceMonthly
            - monthly
          type: string
        personAddress:
          $ref: '#/components/schemas/Address'
        personAddressId:
          description: >
            This is the existing identifier of a borrower's address contact
            information (Peach's

            unique or lender's external identifier). If passed during
            origination, the address will be stored

            on the loan object as a reference. Alternatively, the address can be
            directly provided

            in `personAddress`, in which case, `personAddressId` should not be
            sent.
          pattern: ^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$
          type: string
          writeOnly: true
        promoRates:
          $ref: '#/components/schemas/LoanPromoRatesAtOrigination'
          nullable: true
        rateCaps:
          $ref: '#/components/schemas/RateCapsAtOriginationLoan'
        skipCreditReporting:
          default: false
          description: >
            Set to `true` if the loan should not be reported to the credit
            agencies when activated.
          type: boolean
        specificDays:
          $ref: '#/components/schemas/SpecificDays'
        validAddress:
          default: false
          description: Identifies the address at origination as valid or invalid.
          readOnly: true
          type: boolean
      title: Line of Credit
      type: object
    PaymentHoldDays:
      description: >
        Determines how long the lender wants to wait until a payment affects the
        openToBuy amount in the

        Get balances endpoint.
      nullable: true
      properties:
        holdDayType:
          description: >
            Determines what type of day should be used to calculate the
            `holdDaysEndDate` on the transaction.
          enum:
            - calendar
            - business
          type: string
        numHoldDays:
          description: >
            The number of days Peach's system will wait until the loan's balance
            reflects the amount of payment.


            For example, if `holdDayType=calendar` and a borrower makes a one
            time payment on October 10th (and

            the payment status is `initiated` or `pending`):


            `numHoldDays = 0`, the payment will increase the `openToBuyAmount`
            on the 10th.


            `numHoldDays = 1`, the payment will increase the `openToBuyAmount`
            on the 11th.


            `numHoldDays = 2`, the payment will increase the `openToBuyAmount`
            on the 12th.
          type: integer
      required:
        - holdDayType
        - numHoldDays
      type: object
    LineOfCredit:
      allOf:
        - $ref: '#/components/schemas/BaseMixinWithoutTimestamps'
        - properties:
            loanTypeId:
              description: >
                The loan type identifier. This is created specifically for each
                lender's loan product by Peach.
              type: string
          type: object
        - $ref: '#/components/schemas/BaseLoanMixin'
        - $ref: '#/components/schemas/SharedInstallmentAndLoc'
        - properties:
            additionalPeople:
              description: >
                **DEPRECATED ATTRIBUTE** use the `additionalBorrowers` field
                instead.


                For loans with multiple people attached, use this field to add
                additional people.

                You do not need to include the main borrower, who will be
                created from the url parameter.
              items:
                $ref: '#/components/schemas/PersonLoan'
              type: array
              writeOnly: true
            atOrigination:
              $ref: '#/components/schemas/LineOfCreditAtOrigination'
            current:
              properties:
                autopayEnabled:
                  description: Is autopay enabled for this loan?
                  type: boolean
                creditLimitAmount:
                  description: >
                    The credit limit amount for the line or draw. Only
                    applicable to line of credit or installment loan with
                    multiple

                    advances. For installment loans with multi-advances, it is
                    the amount financed set at origination.
                  format: float
                  type: number
              readOnly: true
              type: object
            isClosed:
              description: >
                Indicates whether the LOC is closed. If `true`, new Draws or
                Purchases cannot be created. The system will continue to create

                statements as long as there is unpaid balance.
              type: boolean
            muteLoanNotices:
              description: >
                Indicates whether the system should stop/pause sending loan
                related notices to the borrower. Set to true if you want to mute
                all loan related notices (e.g. loanDetails. autopayEnabled,
                paymentFailed, etc.) Keep in mind that it will also stop all
                notices related to the loan that are sent from Peach Agent
                Portal by an agent.

                Note: this is not the only attribute that can stop notices from
                being sent. Compliance Guard and Cases Do Not Interact can also
                block communications.
              type: boolean
            newDrawsAllowed:
              description: Indicates if the borrower can make additional draws on the line.
              type: boolean
            nickname:
              description: >
                The loan's nickname. Nickname is a friendly name of the loan and
                is displayed in the UI.

                Nickname is different from loan ID. Nickname can be changed by a
                borrower.
              nullable: true
              type: string
            object:
              enum:
                - lineOfCredit
              readOnly: true
              type: string
            paymentHoldDays:
              $ref: '#/components/schemas/PaymentHoldDays'
            ratesValidation:
              allOf:
                - $ref: '#/components/schemas/InterestRateValidation'
              description: >-
                This object contains information on whether actual rates exceed
                the rate ranges defined on the loan type.
              readOnly: true
            servicedBy:
              $ref: '#/components/schemas/LoanServicer'
            status:
              $ref: '#/components/schemas/LoanStatus'
            type:
              enum:
                - lineOfCredit
              type: string
          required:
            - newDrawsAllowed
          type: object
      title: Line of Credit
    Loan:
      anyOf:
        - $ref: '#/components/schemas/Installment'
        - $ref: '#/components/schemas/LineOfCredit'
      description: |
        Represents a loan. A loan always belongs to a borrower, and most of
        the interactions between a lender and a borrower are associated with a
        particular loan.
      title: Loan
    IsLocked:
      properties:
        isLocked:
          description: >
            If true, the loan is in the middle of being updated or replayed. The
            returned data are not consistent. The caller should poll

            on the `Get loan lock status` endpoint. Once `isLocked`` becomes
            `false`, the caller should call this endpoint again to get
            consistent data.
          type: boolean
      type: object
    AuthorizedAmount:
      description: >
        The total amount of purchases in `authorized` status.


        `authorizedAmount` is used in the calculation of the following amounts:
        `availableCreditAmount`, `openToBuyAmount`, `utilizationAmount`.


        `authorizedAmount` is NOT used in the calculations of the following
        amounts: `overLimitAmount`.


        Only applicable to lines of credit.
      format: float
      type: number
    DueBalances:
      description: Due balances represent balances that are currently due.
      properties:
        dueDrawFeesAmount:
          description: The draw fees portion of `dueFeesAmount`.
          format: float
          type: number
        dueFeesAmount:
          description: >
            The fees portion of the `dueTotalAmount`.


            `dueFeesAmount` is the sum of `dueOriginationFeesAmount`,
            `dueDrawFeesAmount`, `dueLateFeesAmount`,
            `dueModificationFeesAmount`, and `dueMembershipFeesAmount`.
          format: float
          readOnly: true
          type: number
        dueInterestAmount:
          description: The interest portion of the `dueTotalAmount`.
          format: float
          type: number
        dueLateFeesAmount:
          description: The late fees portion of `dueFeesAmount`.
          format: float
          type: number
        dueMembershipFeesAmount:
          description: The membership fees portion of `dueFeesAmount`.
          format: float
          type: number
        dueModificationFeesAmount:
          description: The modification fees portion of `dueFeesAmount`.
          format: float
          type: number
        dueOriginationFeesAmount:
          description: The origination fees portion of `dueFeesAmount`.
          format: float
          type: number
        duePrincipalAmount:
          description: The principal portion of the `dueTotalAmount`.
          format: float
          type: number
        dueTotalAmount:
          description: The total due balance sums due principal, interest, and fees.
          format: float
          readOnly: true
          type: number
      type: object
    NonDueBalances:
      description: Non-due balances represent balances that are not yet due.
      properties:
        nonDueDrawFeesAmount:
          description: The draw fees portion of `nonDueFeesAmount`.
          format: float
          type: number
        nonDueFeesAmount:
          description: >
            The fees portion of the `nonDueTotalAmount`.


            `nonDueFeesAmount` is the sum of `nonDueOriginationFeesAmount`,
            `nonDueDrawFeesAmount`, `nonDueLateFeesAmount`,
            `nonDueModificationFeesAmount`, and `nonDueMembershipFeesAmount`.
          format: float
          readOnly: true
          type: number
        nonDueInterestAmount:
          description: The interest portion of the `nonDueTotalAmount`.
          format: float
          type: number
        nonDueLateFeesAmount:
          description: The late fees portion of `nonDueFeesAmount`.
          format: float
          type: number
        nonDueMembershipFeesAmount:
          description: The membership fees portion of `nonDueFeesAmount`.
          format: float
          type: number
        nonDueModificationFeesAmount:
          description: The modification fees portion of `nonDueFeesAmount`.
          format: float
          type: number
        nonDueOriginationFeesAmount:
          description: The origination fees portion of `nonDueFeesAmount`.
          format: float
          type: number
        nonDuePrincipalAmount:
          description: The principal portion of the `nonDueTotalAmount`.
          format: float
          type: number
        nonDueTotalAmount:
          description: >-
            The total non-due balance sums non-due principal, interest, and
            fees.
          format: float
          readOnly: true
          type: number
      type: object
    OpenToBuyAmount:
      description: >
        The amount of available credit a borrower has based on the
        `utilizationAmount` and transactions' hold day end date.

        The difference between `availableCreditAmount` and the `openToBuyAmount`
        is that `availableCreditAmount` doesn't

        take into account transactions' hold days. In other words,
        `availableCreditAmount` is more optimistic.


        For lines of credit only:
          - `openToBuyAmount` takes into account `authorizedAmount`. Authorized purchases decrease the `openToBuyAmount`.

        Only applicable to lines of credit.
      format: float
      type: number
    OverLimitAmount:
      description: >
        The amount of credit used above the `creditLimitAmount` for the line of
        credit or draw.

        Calculation is `max(0, utilizationAmount - authorizedAmount -
        creditLimitAmount)`,  meaning

        that the over limit amount will only be > 0 if utilization (without
        authorized purchases)

        is greater than credit limit. Otherwise, `overLimitAmount` will always
        be 0.


        For lines of credit only:
          - `overLimitAmount` doesn't take into account `authorizedAmount`. Authorized purchases don't impact the `overLimitAmount`.

        Only applicable to line of credits.
      format: float
      type: number
    OverdueBalances:
      description: Overdue balances represent balances that are overdue.
      properties:
        overdueDrawFeesAmount:
          description: The draw fees portion of `overdueFeesAmount`.
          format: float
          type: number
        overdueFeesAmount:
          description: >
            The fees portion of the `overdueTotalAmount`.


            `overdueFeesAmount` is the sum of `overdueOriginationFeesAmount`,
            `overdueDrawFeesAmount`, `overdueLateFeesAmount`,
            `overdueModificationFeesAmount`, and `overdueMembershipFeesAmount`.
          format: float
          readOnly: true
          type: number
        overdueInterestAmount:
          description: The overdue interest portion of the `overdueTotalAmount`.
          format: float
          type: number
        overdueLateFeesAmount:
          description: The late fees portion of `overdueFeesAmount`.
          format: float
          type: number
        overdueMembershipFeesAmount:
          description: The membership fees portion of `overdueFeesAmount`.
          format: float
          type: number
        overdueModificationFeesAmount:
          description: The modification fees portion of `overdueFeesAmount`.
          format: float
          type: number
        overdueOriginationFeesAmount:
          description: The origination fees portion of `overdueFeesAmount`.
          format: float
          type: number
        overduePrincipalAmount:
          description: The overdue principal portion of the `overdueTotalAmount`.
          format: float
          type: number
        overdueTotalAmount:
          description: >-
            The total overdue balance sums overdue principal, interest, and
            fees.
          format: float
          readOnly: true
          type: number
      type: object
    UtilizationAmount:
      description: >
        The loan or draw utilization amount. In other words, the amount of
        credit used by the borrower.


        For lines of credit only:
          - The amount is calculated based on the loan type `creditLimit.utilizationCalculation` configuration.
            For example: line of credit utilization can be calculated as the sum of principal buckets only without any interest or fees.
          - `utilizationAmount` takes into account `authorizedAmount`. Authorized purchases increase the `utilizationAmount`.
          - The amount can be negative. Negative amount happens only when the total amount of payments made by the borrower plus
            the total amount of service credits exceeds the line or draw balance. Any future purchases will first deplete the
            overpayment amount (also called `reimbursementAmount`).

        Only applicable to line of credits or installment loans with
        multi-advances.
      format: float
      type: number
    Balances:
      allOf:
        - $ref: '#/components/schemas/IsLocked'
        - description: The up-to-date loan balances as of the time of inquiry.
          properties:
            authorizedAmount:
              $ref: '#/components/schemas/AuthorizedAmount'
            availableCreditAmount:
              description: >
                The available credit amount to use. If the borrower exceeded
                their credit limit, the `availableCreditAmount` will be zero.


                For lines of credit only:
                  - `availableCreditAmount` takes into account `authorizedAmount`. Authorized purchases decrease the `availableCreditAmount`.
                  - The amount can be greater than `creditLimitAmount`. It happens only when the total amount of payments made by the borrower
                    plus the total amount of service credits exceeds the line or draw balance. Any future purchases will first deplete the
                    overpayment amount (also called `reimbursementAmount`).

                Only applicable to lines of credit or installment loans with
                multi-advances.
              format: float
              type: number
            calculatedAt:
              description: Timestamp when the balances were calculated.
              format: date-time
              type: string
            chargedOffBalances:
              description: Charged-off balances represent balances that are charged-off.
              properties:
                chargedOffFeesAmount:
                  description: The fees portion of the `chargedOffTotalAmount`.
                  format: float
                  type: number
                chargedOffInterestAmount:
                  description: The interest portion of the `chargedOffTotalAmount`.
                  format: float
                  type: number
                chargedOffPrincipalAmount:
                  description: The principal portion of the `chargedOffTotalAmount`.
                  format: float
                  type: number
                chargedOffTotalAmount:
                  description: >-
                    The total charged-off balance sums charged-off principal,
                    interest, and fees.
                  format: float
                  type: number
              type: object
            creditLimitAmount:
              description: >
                The credit limit amount for the line or draw. Only applicable to
                line of credit or installment loan with multiple

                advances. For installment loans with multi-advances, it is the
                amount financed set at origination.
              format: float
              type: number
            dueBalances:
              $ref: '#/components/schemas/DueBalances'
            interestAndFeesAmounts:
              description: Interest and fees amounts
              properties:
                deferredInterestAccruedTotalAmount:
                  description: >
                    The total deferred interest accrued.


                    - If the deferred interest promotion is exercised, the
                    deferred
                      interest is foregone and therefore this attribute will have a
                      value of zero.
                      In this scenario, the deferred interest amount will "move" to
                      the `forgoneInterestDeferredAmount` attribute.
                    - If the deferred interest promotion is not executed, the
                      deferred interest is recognized as regular interest and
                      therefore this attribute will have a value of zero.
                      In this scenario, the deferred interest amount will "move"
                      to the `interestAccruedTotalAmount` attribute.
                  format: float
                  type: number
                deferredInterestDiscountTotalAmount:
                  description: |
                    The total deferred interest discount.
                  format: float
                  type: number
                feesChargedYearToDateAmount:
                  description: |
                    The amount of fees charged year-to-date.
                  format: float
                  type: number
                forgoneInterestCapAmount:
                  description: >
                    The amount of foregone interest that exceeded the interest
                    cap amount. This is only

                    applicable to loans that had `totalInterestCapAmount` set to
                    `true` at loan origination.
                  format: float
                  type: number
                forgoneInterestDeferredAmount:
                  description: |
                    The amount of interest that was foregone because of deferred
                    interest promotions.
                    This is only applicable to loans with deferred interest
                    promotions that were not executed.
                  format: float
                  type: number
                forgoneInterestRoundingAmount:
                  description: >
                    The amount of interest that was forgone because of rounding.
                    Applicable only to:
                     1. Lines of credit (and draws) with minimum payments
                     1. Lines of credit (and draws) with balloon amortization
                     1. Installment loans with balloon amortization
                  format: float
                  type: number
                interestAccruedTotalAmount:
                  description: >-
                    The total interest accrued - net of interest discount and
                    foregone interest - from the start of the loan to the date
                    of inquiry.
                  format: float
                  type: number
                interestAccruedYearToDateAmount:
                  description: >
                    The amount of interest accrued year-to-date not including
                    interest discounts and forgone interest.
                  format: float
                  type: number
                interestAccruedYearToDateForStatementAmount:
                  description: >
                    This amount should be used for statements. The amount of
                    interest accrued year-to-date not including

                    interest discounts and forgone interest.


                    The Peach system accrues interest on a "following" day based
                    on the principal balance at the end-of-day of a prior day.

                    The interest effective date is the "following" day. For
                    example, interest that accrues on `2022-01-01` is based on
                    the

                    principal balance at the end-of-day of `2021-12-13`. The
                    interest is effectively booked to the ledger on
                    `2022-01-01`.


                    When summarizing year to date interest for a statement, the
                    interest that was accrued effectively on `2022-01-01` should

                    be part of the 2021 year (in the example above). This is the
                    main difference between the
                    `interestAccruedYearToDateAmount`

                    and `interestAccruedYearToDateForStatementAmount` fields.
                  format: float
                  type: number
                interestDiscountTotalAmount:
                  description: >-
                    The total interest discount from the start of the loan to
                    the date of inquiry.
                  format: float
                  type: number
              type: object
            loanStatus:
              $ref: '#/components/schemas/LoanStatus'
            nonAccrualBalances:
              description: Non-accrual balances represent balances that are non-accrual.
              properties:
                nonAccrualFeesAmount:
                  description: The fees portion of the `nonAccrualTotalAmount`.
                  format: float
                  type: number
                nonAccrualInterestAmount:
                  description: The interest portion of the `nonAccrualTotalAmount`.
                  format: float
                  type: number
                nonAccrualPrincipalAmount:
                  description: The principal portion of the `nonAccrualTotalAmount`.
                  format: float
                  type: number
                nonAccrualTotalAmount:
                  description: >-
                    The total non-accrual balance sums non-accrual principal,
                    interest, and fees.
                  format: float
                  type: number
              type: object
            nonDueBalances:
              $ref: '#/components/schemas/NonDueBalances'
            openToBuyAmount:
              $ref: '#/components/schemas/OpenToBuyAmount'
            outstandingBalances:
              description: >
                When a loan is `active`, outstanding balances combine non-due,
                due, and overdue balances. When a loan is

                `accelerated`, outstanding balances are equal to non-accrual
                balances. When a loan is `chargedOff`,

                outstanding balances are equal to charged-off balances.
              properties:
                outstandingDrawFeesAmount:
                  description: The draw fees portion of `outstandingFeesAmount`.
                  format: float
                  type: number
                outstandingFeesAmount:
                  description: >
                    The fees portion of the `outstandingTotalAmount`.


                    `outstandingFeesAmount` is the sum of
                    `outstandingOriginationFeesAmount`,
                    `outstandingDrawFeesAmount`, `outstandingLateFeesAmount`,
                    `outstandingModificationFeesAmount`, and
                    `outstandingMembershipFeesAmount`.
                  format: float
                  type: number
                outstandingInterestAmount:
                  description: The interest portion of the `outstandingTotalAmount`.
                  format: float
                  type: number
                outstandingLateFeesAmount:
                  description: The late fees portion of `outstandingFeesAmount`.
                  format: float
                  type: number
                outstandingMembershipFeesAmount:
                  description: The membership fees portion of `outstandingFeesAmount`.
                  format: float
                  type: number
                outstandingModificationFeesAmount:
                  description: The modification fees portion of `outstandingFeesAmount`.
                  format: float
                  type: number
                outstandingOriginationFeesAmount:
                  description: The origination fees portion of `outstandingFeesAmount`.
                  format: float
                  type: number
                outstandingPrincipalAmount:
                  description: The principal portion of the `outstandingTotalAmount`.
                  format: float
                  type: number
                outstandingTotalAmount:
                  description: >
                    The total outstanding balance sums outstanding principal,
                    interest, and fees. Also called the loan payoff amount.


                    If the loan is charged off, the outstanding totalAmount will
                    be equal to the `chargedOffTotalAmount`.
                  format: float
                  type: number
              type: object
            outstandingBalancesWithPromo:
              description: >
                Promotional balances represent various balances needed to be
                paid in order to exercise the same-as-cash or

                other promotional program.
              properties:
                outstandingTotalAmount:
                  description: >
                    The remaining amount needed to be paid in order to exercise
                    the same-as-cash or other promotional program.
                  format: float
                  nullable: true
                  type: number
              type: object
            overLimitAmount:
              $ref: '#/components/schemas/OverLimitAmount'
            overdueBalances:
              $ref: '#/components/schemas/OverdueBalances'
            overdueNumberDays:
              description: >-
                If the loan is currently overdue, this represents the number of
                days the loan has been overdue.
              type: integer
            paidBalances:
              description: Paid balances represent the amounts paid to date.
              properties:
                paidCreditsAmount:
                  description: >-
                    The total amount of service credits applied to the loan
                    until today.
                  format: float
                  type: number
                paidFeesAmount:
                  description: The total amount of fees paid until today.
                  format: float
                  type: number
                paidInterestAmount:
                  description: The total amount of interest paid until today.
                  format: float
                  type: number
                paidOverAmount:
                  description: >-
                    Stores any excess amount that was not allocated to
                    principal, interest or fees.
                  format: float
                  type: number
                paidPaymentsAmount:
                  description: >-
                    The total amount of payments applied to the loan until
                    today, excluding reimbursements.
                  format: float
                  type: number
                paidPrincipalAmount:
                  description: The total amount of principal paid until today.
                  format: float
                  type: number
                paidReimbursementsAmount:
                  description: >-
                    The total amount of reimbursements applied to the loan until
                    today.
                  format: float
                  type: number
                paidTotalAmount:
                  description: >-
                    The total payment and service credits made from the start of
                    the loan to the date of inquiry. Excludes reimbursements.
                  format: float
                  type: number
              type: object
            reimbursementAmount:
              description: >
                The total amount that a lender owes to the borrower. After a
                reimbursement is processed, the amount is reduced accordingly.
              format: float
              type: number
            utilizationAmount:
              $ref: '#/components/schemas/UtilizationAmount'
          type: object
    FutureBalances:
      allOf:
        - $ref: '#/components/schemas/IsLocked'
        - description: The projected loan balances as of the time of inquiry.
          properties:
            expectedTotalAmount:
              description: >
                The total amount the borrower is projected to pay under the
                assumption of continued on-time payments.
              format: float
              type: number
            projectedPayoffDate:
              description: >
                Date for when the loan is expected to be paid off, assuming
                current balances and expected payments or autopays.
              format: date
              type: string
            projectedTotalDueBalanceTenDays:
              description: >
                This is the projected loan total due balance in 10 calendar days
                from today. The difference between today's

                `outstandingTotalBalance` and the estimate in 10 days is only
                the interest that would accrue on the loan.
              format: float
              type: number
          type: object
    LoanTypeCompanyConfigOverride:
      additionalProperties: false
      description: |
        Same as the company config, but stored on a loan type object, allowing
        for overriding a subset of global settings on a per-loan-type basis.
        If a value is not configured at the loan type level, the system will
        fall back to the company-level configuration.

        **Note**: Any property can be set to `null` to clear the override and
        fall back to the company-level configuration for that specific property.
      properties:
        brandAssets:
          allOf:
            - $ref: '#/components/schemas/CompanyConfigBrandAssets'
          nullable: true
        brandName:
          description: |
            The name of the company for presentation to the end consumer
            (same as company.brandName)
          nullable: true
          type: string
        collections:
          additionalProperties: false
          nullable: true
          properties:
            autoInitiate:
              additionalProperties: false
              nullable: true
              properties:
                enableReviewTask:
                  description: >
                    By default, when a collection case is created automatically,

                    a task of type `reviewAutoCreatedCase` is created in

                    taskrouter—the assumption being that usually a human should

                    review automatically created cases.


                    To disable the creation of this task set this config to
                    `false`.
                  nullable: true
                  type: boolean
              type: object
          type: object
        legalName:
          description: Legal name of the company (same as company.legalName)
          nullable: true
          type: string
        links:
          allOf:
            - $ref: '#/components/schemas/CompanyConfigLinks'
          nullable: true
        openHours:
          allOf:
            - $ref: '#/components/schemas/CompanyConfigOpenHours'
          nullable: true
        showPoweredByPeach:
          description: |
            Corresponds to /bootstrap.company.showPoweredByPeach.
            Controls whether to show "Powered by Peach" branding.
          nullable: true
          type: boolean
        support:
          allOf:
            - $ref: '#/components/schemas/CompanyConfigSupport'
          nullable: true
        timezone:
          allOf:
            - $ref: '#/components/schemas/CompanyConfigTimezone'
          nullable: true
        ui:
          allOf:
            - $ref: '#/components/schemas/CompanyConfigUi'
          nullable: true
      title: Loan Type Company Config Override
      type: object
    CreditAgenciesIdentifiers:
      description: >
        You can report to one or more credit reporting agencies. Make sure to
        set identifiers for each agency you

        plan to report in the `metro2` object.


        This endpoint sets identifiers for loans with the same `loanTypeId` (aka
        portfolio). If you have more than

        one loan type (meaning different portfolios), you need to create
        identifiers for each `loanTypeId`.


        In addition, you need to create file upload details using `Create credit
        agency` for each credit agency.

        The file upload details need to be set once per credit agency, and all
        `loanTypeId` (aka all portfolios)

        will be uploaded to the same location.
      properties:
        isCreditReportingAllowed:
          type: boolean
        metro2:
          properties:
            accountType:
              description: |
                Account type.

                Installment:
                00–05,10,11,13,17,20,90,91,95,0A, 3A, 6A, 9A, 7B, 0F

                LOC:
                15, 43, 47, 7A, 9B
              maxLength: 2
              type: string
            creditorClassification:
              description: >
                Creditor Classification.


                01=Retail

                02=Medical/Health Care

                Required when reporting medical debts and returned checks from
                providers of medical services, products or devices

                03=Oil Company

                04=Government

                05=Personal Services

                06=Insurance

                07=Educational

                08=Banking

                09=Rental/Leasing

                10=Utilities

                11=Cable/Cellular

                12=Financial

                (other non-banking financial institutions)

                13=Credit Union

                14=Automotive

                15=Check Guarantee
              enum:
                - '01'
                - '02'
                - '03'
                - '04'
                - '05'
                - '06'
                - '07'
                - 8
                - 9
                - '10'
                - '11'
                - '12'
                - '13'
                - '14'
                - '15'
              maxLength: 2
              type: string
            equifaxIdentificationNumber:
              description: |
                Equifax Identification number.
              maxLength: 20
              type: string
            equifaxProgramIdentifier:
              description: |
                Equifax program identifier.
                This is a String of 10 chars.
              maxLength: 10
              type: string
            experianIdentificationNumber:
              description: |
                Experian Identification number.
              maxLength: 20
              type: string
            experianProgramIdentifier:
              description: |
                Experian program identifier.
                This is a String of 5 chars.
              maxLength: 5
              type: string
            innovisIdentificationNumber:
              description: |
                Innovis Identification number.
              maxLength: 20
              type: string
            innovisProgramIdentifier:
              description: |
                Innovis program identifier.
                This is a String of 10 chars.
              maxLength: 10
              type: string
            interestTypeIndicator:
              description: |
                Interest type indicator.

                `F` - means that the interest is reported as fixed.

                `V` - means that the interest is reported as variable/adjustable
              maxLength: 1
              type: string
            microBiltPrbcProgramIdentifier:
              description: |
                MicroBilt/PRBC program identifier.
              maxLength: 10
              type: string
            portfolioType:
              description: |
                Portfolio type.

                C=Line of Credit

                I=Installment

                M=Mortgage

                O=Open

                R=Revolving
              enum:
                - C
                - I
                - M
                - O
                - R
              maxLength: 1
              type: string
            reporterAddress:
              description: |
                Reporter address.
                This is a String of 96 chars.
              maxLength: 96
              type: string
            reporterName:
              description: |
                Reporter name.
                This is a String of 40 chars.
              maxLength: 40
              type: string
            reporterTelephoneNumber:
              description: |
                Reporter telephone number.
              maxLength: 10
              type: string
            roundingMethod:
              default: roundDownWhole
              description: >
                Monetary fields are reported in whole dollars only in Metro2.


                - `roundUpWhole` - an amount will be rounded up to the nearest
                dollar. For example: $4.02 -> $5.

                - `roundDownWhole` - an amount will be rounded down to the
                nearest dollar with one exception:
                  If the amount is less than one dollar, the system will report it as one dollar vs. zero.
                  For example: $1.98 -> $1, $0.03 -> $1.
              enum:
                - roundDownWhole
                - roundUpWhole
              type: string
            skipSegments:
              description: |
                Segments excluded from Metro2. The reported data depends on the
                loan type configuration. If the loan type specifies a segment to
                be skipped, the segment will not be reported even if the loan
                details include it.

                For example: If a lender sets `metro2.reportK2Segment`= `true`
                when a loan is assigned to a debt collection agency or investor
                has changed but `skipSegments` includes `k2Segment`, the K2
                segment won't be reported
              items:
                enum:
                  - header
                  - baseSegment
                  - k1Segment
                  - k2Segment
                  - l1Segment
                type: string
              type: array
            softwareVendorName:
              default: Peach Finance Inc.
              description: |
                Software vendor name.
              maxLength: 40
              type: string
            softwareVersionNumber:
              default: '1.1'
              description: |
                Software version number.
              maxLength: 5
              type: string
            transunionIdentificationNumber:
              description: |
                TransUnion Identification number.
              maxLength: 20
              type: string
            transunionProgramIdentifier:
              description: |
                TransUnion program identifier.
                This is a String of 10 chars.
              maxLength: 10
              type: string
          type: object
      type: object
    DayType:
      description: Whether day field refers to weekends and holidays or only business days.
      enum:
        - business
        - calendar
      type: string
    BalanceCheck:
      description: Balance check configuration
      nullable: true
      properties:
        checkOffsetDays:
          description: Number of days before payment to check for the balance
          minimum: 0
          type: integer
        debitLogic:
          items:
            properties:
              action:
                description: >
                  `debit` - Debit the account. \

                  `reschedule` - The system will reschedule the payment to
                  "payment due date + `rescheduleBufferInDays`". \

                  `cancel` - Cancel the payment.
                enum:
                  - cancel
                  - debit
                  - reschedule
                type: string
              condition:
                description: >
                  `balanceNA` - means that the payment method used cannot check
                  balances. \

                  For example: debit card or bank account that was never
                  connected to a balance check (or was disconnected manually by
                  the borrower).

                  It means that "account link" status is "inactive" or the
                  account link object is empty.


                  `balanceBroken` - there is a balance connection object, but
                  it's broken - due to an error. \
                    It means that "account link" status is "active", but there is an errorCode exists.

                  `balanceGreen` - account balance is more than `balanceYellow`
                  and significantly more than the scheduled amount.
                enum:
                  - balanceNA
                  - balanceBroken
                  - balanceRed
                  - balanceYellow
                  - balanceGreen
                type: string
            type: object
          type: array
        enabled:
          description: >-
            If enabled, balance check will be performed based on the
            configuration prior to processing bank account payments.
          type: boolean
        rescheduleBufferDayType:
          $ref: '#/components/schemas/DayType'
        rescheduleBufferInDays:
          description: Number of days buffer to reschedule the payment.
          type: integer
        thresholds:
          items:
            properties:
              value:
                description: >
                  The percentage value for the specified zone (1 = 100% of the
                  scheduled payment, 1.2 = 120% of the scheduled payment, etc.).
                format: float
                type: number
              zone:
                description: >
                  Thresholds represented as multiple of the scheduled payment
                  amount.


                  `balanceRed` - account balance is less than scheduled amount.
                  \

                  `balanceYellow` - account balance is more than the scheduled
                  amount but not by much. \
                enum:
                  - balanceRed
                  - balanceYellow
                type: string
            type: object
          type: array
      type: object
    MultiLoanPaymentWaterfall:
      properties:
        loansOrder:
          description: >
            `highestInterestRate` - the loan or draw with the highest interest
            rate


            `lowestInterestRate` - the loan or draw with the lowest interest
            rate


            `oldestLoanDate` - the oldest loan or draw


            `newestLoanDate` - the newest loan or draw


            `highestOutstandingBalance` - the loan or draw with the highest
            outstanding balance


            `lowestOutstandingBalance` - the loan or draw with the lowest
            outstanding balance
          items:
            enum:
              - highestInterestRate
              - lowestInterestRate
              - oldestLoanDate
              - newestLoanDate
              - highestOutstandingBalance
              - lowestOutstandingBalance
              - activeFirst
              - chargedOffFirst
            type: string
          type: array
        transactionType:
          description: >
            The transaction type.


            `payment` - payment made by the borrower or by a service agent per
            borrower request.

            Can be one-time payment, future payment or Autopay.

            Successful payments reduce loan balance.


            `serviceCredit` - service credit issued by a service agent or
            supervisor. Successful service

            credits reduce loan balance.
          enum:
            - payment
            - serviceCredit
          type: string
      type: object
    BalancesEnum:
      enum:
        - overdueFee
        - overdueAccruedInterest
        - overduePrincipal
        - dueFee
        - dueAccruedInterest
        - duePrincipal
        - nonDueFee
        - nonDueAccruedInterest
        - nonDuePrincipal
        - chargedOffPrincipal
        - chargedOffAccruedInterest
        - chargedOffFee
        - nonAccrualFee
        - nonAccrualInterest
        - nonAccrualPrincipal
      type: string
    SingleLoanPaymentWaterfall:
      properties:
        balancesOrder:
          description: >
            When loan is in `active` status, the following buckets are relevant
            for waterfall:

            `overdueFee`, `overdueAccruedInterest`, `overduePrincipal`,
            `dueFee`, `dueAccruedInterest`, `duePrincipal`, `nonDueFee`,
            `nonDueAccruedInterest`, `nonDuePrincipal`.


            When loan is in `chargedOff` status, the following buckets are
            relevant for waterfall:

            `chargedOffPrincipal`, `chargedOffAccruedInterest`, `chargedOffFee`


            When loan is in `accelerated` status, the following buckets are
            relevant for waterfall:

            `nonAccrualPrincipal`, `nonAccrualInterest`, `nonAccrualFee`


            During payment application, when any fee bucket is reached
            (nonDueFee, dueFee, etc.), fees in that bucket are paid

            based on the order defined by the `feesOrder` attribute.
          items:
            $ref: '#/components/schemas/BalancesEnum'
          type: array
        feesOrder:
          description: >
            The order of fees during payment application. When any fee bucket is
            reached

            (nonDueFee, dueFee, etc.) during payment application, fees in that
            bucket are

            paid down in the order defined by `feesOrder`.


            Please note that `modificationFee` bucket includes the following fee
            types:

            `foreignTransactionFee`, `modificationFee`, `purchaseFee`,
            `serviceFee`, `nsfFee`.


            If `feesOrder` is omitted or an empty list, the default order is
            applied:

            `originationFee`, `drawFee`, `modificationFee`, `lateFee`,
            `membershipFee`.
          items:
            enum:
              - originationFee
              - drawFee
              - modificationFee
              - lateFee
              - membershipFee
            type: string
          type: array
        loanStatus:
          enum:
            - active
            - accelerated
            - chargedOff
          type: string
        transactionType:
          description: >
            The transaction type.


            `payment` - payment made by the borrower or by a service agent per
            borrower request.

            Can be one-time payment, future payment or Autopay.

            Successful payments reduce loan balance.


            `serviceCredit` - service credit issued by a service agent or
            supervisor. Successful service

            credits reduce loan balance.
          enum:
            - payment
            - serviceCredit
          type: string
      type: object
    PaymentWaterfall:
      properties:
        multi:
          description: >
            Multiple loans (or draws for Line-of-Credit loans) payment waterfall
            application
          items:
            $ref: '#/components/schemas/MultiLoanPaymentWaterfall'
          type: array
        single:
          description: |
            Single loan payment waterfall application.
          items:
            $ref: '#/components/schemas/SingleLoanPaymentWaterfall'
          type: array
      type: object
    LoanType:
      description: >
        A Loan Configuration is a representation of a Loan Product and its
        specific

        settings and configurations
      properties:
        assetDisplayName:
          description: >
            The asset display name. For example: Loan, Line of Credit, Lease,
            Credit Card.
          maxLength: 50
          minLength: 0
          type: string
        assetType:
          $ref: '#/components/schemas/LoanAssetType'
        automatedDebtValidationNotification:
          description: >
            Some states require automatic debt validation notices to be sent to
            borrowers. We are aware of in the following states: Illinois,
            Maryland, Massachusetts, Minnesota, Nevada, Tennessee, Wyoming,
            Arizona, Puerto Rico, DC.

            Peach can automatically send the debt validation notices based on
            two triggers:

              1. On loan activation event - `loanActivation`:
                The notice will be sent (once) when a loan is activated.
              2. On first overdue event - `loanFirstOverdue`:
                The notice will be sent (once) when a loan becomes overdue for the first time.

            Please configure which of the states you'd like to elect into
            receiving the automatic debt validation notice. Use the option where
            the state is left blank to specify the default option for remaining
            states (or remove the "catch all" entirely).

            Below is an example with a list of states and corresponding
            templates:


            ```

            [
              ["IL", "US", "debtValidationNoticeAutomatic", "loanActivation"],
              ["MD", "US", "debtValidationNoticeAutomatic", "loanActivation"],
              ["MA", "US", "debtValidationNoticeAutomatic", "loanFirstOverdue"],
              ["MN", "US", "debtValidationNoticeAutomatic", "loanFirstOverdue"],
              ["NV", "US", "debtValidationNoticeAutomatic", "loanFirstOverdue"],
              ["TN", "US", "debtValidationNoticeAutomatic", "loanActivation"],
              ["WY", "US", "debtValidationNoticeAutomatic", "loanActivation"],
              ["AZ", "US", "ArizonaDebtValidationNotice", "loanActivation"],
              ["PR", "US", "PuertoRicoDebtValidationNotice", "loanFirstOverdue"],
              ["", "US", "debtValidationNoticeAutomatic", "loanFirstOverdue"],
            ]

            ```
          items:
            description: >
              An array of three or four elements mapping a state to a debt
              validation notice template and trigger.


              If only three elements are included the fourth is assumed to be
              `"loanActivation"`
            example:
              - IL
              - US
              - debtValidationNoticeAutomatic
              - loanActivation
            items:
              type: string
            type: array
          type: array
        companyConfigOverride:
          $ref: '#/components/schemas/LoanTypeCompanyConfigOverride'
          description: |
            The company config override for this loan type. This field is only
            populated when `?include=companyConfigOverride` is specified in the
            query parameters. Otherwise, it will be `null`.
          nullable: true
        creditReporting:
          $ref: '#/components/schemas/CreditAgenciesIdentifiers'
        currency:
          default: USD
          description: The currency used in loans of this type.
          type: string
        description:
          description: An optional description for the loan product
          nullable: true
          type: string
        externalId:
          description: An optional client unique identifier for the loan product
          maxLength: 255
          minLength: 0
          nullable: true
          type: string
        extraFields:
          additionalProperties: true
          nullable: true
          type: object
        fees:
          properties:
            originationFeeAPRCalcOverride:
              default: noOverride
              description: >
                If `noOverride` the APR will be calculated as if the origination
                fee will be calculated per the

                `originationFeeChargeLogic`. If `atOrigination` the APR will be
                calculated as if origination fee

                was collected at origination regardless of the
                `originationFeeChargeLogic`.
              enum:
                - noOverride
                - atOrigination
              type: string
            originationFeeChargeLogic:
              $ref: '#/components/schemas/FeeChargeLogic'
            originationFeeDisplayName:
              default: Origination Fee
              description: >
                The display name of the origination fee as shown to the borrower
                in the UI. For example: "Origination fee" or "Set up fee".
              type: string
          type: object
        futurePay:
          properties:
            achDebitTiming:
              enum:
                - initiateOnDueDate
                - hitOnDueDate
              type: string
            achDebitTimingShiftOnNonBusinessDay:
              description: >
                Controls ACH transaction creation timing when
                `autoPay.achDebitTiming="hitOnDueDate"`.

                Not applicable for transaction types other than ACH or when
                `autoPay.achDebitTiming="initiateOnDueDate"`.
              enum:
                - forward
                - backward
              type: string
            balanceCheck:
              $ref: '#/components/schemas/BalanceCheck'
            overpaymentAmountLimitFactor:
              default: 1.5
              description: >
                The multiplier will be used to calculate the maximum amount
                allowed to be scheduled as one-time payment.

                For example:


                If the value is 1.2 and the current outstanding balance is
                $200.00. The maximum amount that a one-time payment is allowed
                is $200.00 * 1.2 = $240.00
              format: float
              minimum: 1
              type: number
          type: object
        managedByPeach:
          description: >-
            If true, this loan will be completely managed by the system
            including amortization, interest accrual etc.
          type: boolean
        name:
          description: An optional name for the loan product
          maxLength: 255
          minLength: 0
          nullable: true
          type: string
        openToBuyCalculation:
          description: >
            Defines the lender's configuration to determine the "Open to Buy"
            amount. Only applicable to `lineOfCredit`.
          nullable: true
          properties:
            calculationType:
              description: >
                This calculation determines whether transactions' `status`
                and/or `holdDaysEndDate` are used when calculating open-to-buy.


                transactionStatus - open-to-buy will take into account
                transaction status only. Open-to-buy will not be adjusted if the

                transaction status is in [initiated, pending] regardless of the
                transaction's `holdDaysEndDate`.


                transactionHoldDays - open-to-buy will take into account
                transaction hold days only. Open-to-buy will not be adjusted

                if the transaction status is in [initiated, pending, succeeded]
                AND the transaction is within holdDaysEndDate.


                transactionStatusAndHoldDays - Open-to-buy will take into
                account transaction status and hold days period. Open-to-buy

                will not be adjusted if the transaction status is in [initiated,
                pending] AND the transaction is within hold days periods.


                openToBuyCalculation=transactionStatus


                | tx status   | within hold days window   | after hold days
                window    |

                |-------------|---------------------------|---------------------------|

                | Initiated   | Open-to-buy not adjusted  | Open-to-buy not
                adjusted  |

                | Pending     | Open-to-buy not adjusted  | Open-to-buy not
                adjusted  |

                | Succeeded   | Open-to-buy adjusted      | Open-to-buy
                adjusted      |



                openToBuyCalculation=transactionHoldDays


                | tx status   | within hold days window   | after hold days
                window    |

                |-------------|---------------------------|---------------------------|

                | Initiated   | Open-to-buy not adjusted  | Open-to-buy
                adjusted      |

                | Pending     | Open-to-buy not adjusted  | Open-to-buy
                adjusted      |

                | Succeeded   | Open-to-buy not adjusted  | Open-to-buy
                adjusted      |



                openToBuyCalculation=transactionStatusAndHoldDays


                | tx status   | within hold days window   | after hold days
                window    |

                |-------------|---------------------------|---------------------------|

                | Initiated   | Open-to-buy not adjusted  | Open-to-buy
                adjusted      |

                | Pending     | Open-to-buy not adjusted  | Open-to-buy
                adjusted      |

                | Succeeded   | Open-to-buy adjusted      |Open-to-buy
                adjusted       |
              enum:
                - transactionStatus
                - transactionHoldDays
                - transactionStatusAndHoldDays
              type: string
          type: object
        paydayNotices:
          properties:
            sendConsumerRightsNotice:
              default: false
              description: >
                Indicates if the system should send Payday Consumer Rights
                Notice to the Borrower via email after two consecutive

                failed debit attempts.
              type: boolean
            sendFirstPaymentWithdrawalNotice:
              default: false
              description: >
                Indicates if the system should send Payday First Payment
                Withdrawal Notice to the Borrower via email and text message at

                least 3 business days prior to the scheduled payment.
              type: boolean
          type: object
        paymentAllowedWhenChargedOff:
          default: false
          type: boolean
        paymentHoldDays:
          $ref: '#/components/schemas/PaymentHoldDays'
        paymentWaterfall:
          $ref: '#/components/schemas/PaymentWaterfall'
        refunds:
          properties:
            isRefundAllowed:
              description: Whether a borrower can receive a refund.
              type: boolean
          type: object
        snapshots:
          description: Loan daily snapshots
          properties:
            reportDaysWhenPaidOff:
              default: 10
              minimum: 10
              type: integer
          type: object
        status:
          description: The status of the loan type
          enum:
            - inactive
            - active
          type: string
        timezone:
          description: >
            The optional timezone configuration for the loan type, represented
            as a valid tz code

            string such as "UTC" or "America/Los_Angeles". If `null`, the
            timezone defaults to the

            timezone configuration on the company.
          nullable: true
          type: string
        txDescriptorAssetDisplayName:
          default: Loan
          description: >
            Text that will be used in transaction descriptor.

            The descriptor is shown in customer online bank account or
            statement.

            The text must be limited to 4 characters. If more than 4 characters
            are set, the logic will trim the text and use only first 4
            characters.

            For example: LOAN, LINE, CARD, PLAN, etc. The full description will
            look like: LOAN PYMT, CARD PYMT.
          type: string
        useExternalIdInUI:
          type: boolean
      required:
        - assetType
        - assetDisplayName
      type: object
    NameNotNullable:
      description: Name of the person.
      nullable: false
      properties:
        createdAt:
          format: date-time
          readOnly: true
          type: string
        current:
          default: true
          description: Name is flagged as current.
          readOnly: true
          type: boolean
        deletedAt:
          format: date-time
          nullable: true
          readOnly: true
          type: string
        effectiveAt:
          format: date-time
          nullable: true
          readOnly: true
          type: string
        firstName:
          description: A person's first name.
          maxLength: 50
          type: string
        id:
          readOnly: true
          type: string
        lastName:
          description: A person's last name.
          maxLength: 50
          type: string
        maidenLastName:
          description: A person's maiden name, if applicable.
          nullable: true
          type: string
        middleName:
          description: A person's middle name.
          maxLength: 50
          nullable: true
          type: string
        object:
          default: name
          enum:
            - name
          readOnly: true
          type: string
        originalValue:
          description: The original value for name before an update.
          readOnly: true
          type: object
        preferredFirstName:
          description: >
            A person's preferred first name. This name will be used for
            interactions

            like emails, text messages, outbound calls, online portal, etc.

            If no preferred name is provided, `firstName` will be used.
          nullable: true
          type: string
        prefix:
          description: A person's name prefix.
          nullable: true
          type: string
        source:
          enum:
            - peach
            - lender
            - externalAPI
          readOnly: true
          type: string
        status:
          enum:
            - active
            - inactive
          readOnly: true
          type: string
        suffix:
          description: A person's name suffix.
          maxLength: 5
          nullable: true
          type: string
        updatedAt:
          format: date-time
          nullable: true
          readOnly: true
          type: string
      required:
        - firstName
        - lastName
      type: object
    PersonNoIdentity:
      allOf:
        - $ref: '#/components/schemas/BasePersonNoIdentity'
        - properties:
            dateOfBirth:
              description: The date of birth. All times are in UTC.
              format: date
              nullable: true
              type: string
            name:
              $ref: '#/components/schemas/NameNotNullable'
            object:
              default: person
              enum:
                - person
              readOnly: true
              type: string
          type: object
      title: Person
    IdentityBase:
      description: |
        The borrower's identifier. For example, the Social Security number.
      properties:
        createdAt:
          format: date-time
          readOnly: true
          type: string
        customIdentityTypeName:
          description: >
            The name of a personal or business ID. Required if
            `identityType=customID`. This needs to be "one word"

            only US (a-zA-Z) letters. No numbers.


            For example: Metrica Consular Card for Mexicans living abroad.

            - `identityType=customID`

            - `customIdentityTypeName=metricaConsularCard`
          maxLength: 50
          minLength: 1
          pattern: ^[a-zA-Z]+$
          type: string
        deletedAt:
          format: date-time
          nullable: true
          readOnly: true
          type: string
        expirationDate:
          description: |
            Date the identification expires.
          format: date
          nullable: true
          type: string
        id:
          readOnly: true
          type: string
        identityType:
          description: >
            Personal and business identifiers that are supported.

            `customID` can be used for personal or business IDs that are not
            explicitly listed as one of the enum values.

            If you pass `identityType=customID`, a `customIdentityTypeName` is
            also required.


            For example: Metrica Consular Card for Mexicans living abroad.

            - `identityType=customID`

            - `customIdentityTypeName=metricaConsularCard`
          enum:
            - SSN
            - ITIN
            - passport
            - driversLicense
            - taxID
            - FEIN
            - stateID
            - customID
          type: string
        issueDate:
          description: |
            Date the identification was issued.
          format: date
          nullable: true
          type: string
        issuingCountry:
          default: ''
          description: >
            Country that issued the identification. English short name according
            to ISO 3166-1 standard.
          type: string
        object:
          default: identity
          enum:
            - identity
          readOnly: true
          type: string
        updatedAt:
          format: date-time
          nullable: true
          readOnly: true
          type: string
        valid:
          default: true
          description: |
            Whether the identity is valid.
          type: boolean
        value:
          description: |
            The value of a personal identifier. For example, *123456789*.
          type: string
      type: object
    IdentityPut:
      allOf:
        - $ref: '#/components/schemas/IdentityBase'
        - properties:
            isArchived:
              description: >
                Determines whether the identity has been archived. By default,
                only non-archived

                identities are shown. Cannot be changed for primary identities.
              type: boolean
          type: object
    Identity:
      allOf:
        - $ref: '#/components/schemas/IdentityPut'
        - properties:
            isPrimary:
              default: false
              description: >
                Whether the identity is the borrower's primary identity or not.
                A borrower may

                only have one primary identity. Primary identities can be
                created when

                creating a borrower, or separately.
              type: boolean
          type: object
    Person:
      allOf:
        - $ref: '#/components/schemas/PersonNoIdentity'
        - properties:
            identities:
              items:
                $ref: '#/components/schemas/Identity'
              readOnly: true
              type: array
            identity:
              allOf:
                - $ref: '#/components/schemas/IdentityBase'
                - required:
                    - identityType
                    - value
                  type: object
                  writeOnly: true
          required:
            - name
          type: object
      title: Person
    BusinessDetails:
      description: The business details.
      properties:
        businessLegalName:
          description: The business' legal name.
          type: string
        businessName:
          description: The business' name or DBA.
          type: string
        businessType:
          description: The business type.
          enum:
            - LLC
            - cCorporation
            - sCorporation
            - generalPartnership
            - limitedPartnership
            - soleProprietor
            - nonProfit
            - other
            - cooperative
            - independentContractor
            - selfEmployed
            - veteransOrganization
            - tribalBusiness
            - soleTrader
            - incorporatedAssociation
            - unincorporatedAssociation
            - trust
            - unitTrust
            - appointorTrust
          type: string
        incorporatedCountry:
          description: >-
            The country where the business was incorporated or organized.
            English short name according to ISO 3166-1 standard.
          type: string
        incorporatedState:
          description: >
            The state or province code (not full name) where the business was
            incorporated or organized. For example: CA.
          type: string
      required:
        - businessType
        - businessName
        - businessLegalName
      type: object
    BusinessNoIdentity:
      allOf:
        - $ref: '#/components/schemas/BasePersonNoIdentity'
        - properties:
            businessDetails:
              $ref: '#/components/schemas/BusinessDetails'
            object:
              default: business
              enum:
                - business
              readOnly: true
              type: string
          required:
            - businessDetails
          type: object
      title: Business
    Business:
      allOf:
        - $ref: '#/components/schemas/BusinessNoIdentity'
        - properties:
            identities:
              items:
                $ref: '#/components/schemas/Identity'
              readOnly: true
              type: array
            identity:
              allOf:
                - $ref: '#/components/schemas/IdentityBase'
                - required:
                    - identityType
                    - value
                  type: object
                  writeOnly: true
          type: object
      title: Business
    Borrower:
      anyOf:
        - $ref: '#/components/schemas/Person'
        - $ref: '#/components/schemas/Business'
    TransactionCancelReason:
      default: canceledByUser
      description: Why the transaction was canceled.
      enum:
        - invalidPaymentMethod
        - paymentMethodRemoved
        - tooManyFailedAttempts
        - loanFrozen
        - loanAccelerated
        - loanChargedOff
        - loanPaidOff
        - canceledByUser
        - loanTermsChanged
        - balanceCheckThresholdExceeded
      nullable: true
      type: string
    HoldDaysEndDate:
      description: >
        Allows lenders to configure the `openToBuyAmount` calculation. Peach's
        system will not include the transaction in

        the `openToBuyAmount` calculation until this date (in the product
        timezone). For example, if a transaction's `holdDaysEndDate` is tomorrow
        or

        later, the transaction will NOT be included in the `openToBuyAmount`
        calculation.

        Setting this value will override `loan.paymentHoldDays.numHoldDays` and
        `loanType.paymentHoldDays.numHoldDays`.


        If `holdDaysEndDate` is not set upon transaction create, the
        `holdDaysEndDate` will be calculated based on

        `loan.paymentHoldDays.numHoldDays`.


        If `loan.paymentHoldDays.numHoldDays` is not set, `holdDaysEndDate` will
        be calculated based on

        `loanType.paymentHoldDays.numHoldDays`.

        This will only apply to borrower payments and is not applicable for
        other types of transactions (e.g. service credits)
      format: date
      nullable: true
      type: string
    TransactionStatus:
      description: >
        The transaction status.

         - `scheduled` - payment or credit was scheduled for a future date that has not arrived yet. The payment has not applied to a loan yet.
         - `initiated` - payment was initiated and sent to a payment processor. The payment is applied to a loan. This status is used normally for ACH.
         - `pending` - payment was acknowledged by the payment processor and is being processed. For ACH the payment can be in pending status for a few days.
         - `succeeded` - payment was completed successfully.
         - `failed` - payment failed and was removed from the loan effective as of `initiated`, `pending` or `succeeded` status effective date. The system replays the loan as if the payment never happened.
            It will also re-accrue interest since then.
         - `inDispute` - payment is in dispute (typically because of chargeback). The payment is removed from the loan effective as of `initiated`, `pending` or `succeeded` status effective date. The system replays the loan as if the payment never happened.
           It will also re-accrue interest since then. Disputed payment can be for partial amount.
         - `canceled` - payment or credit was canceled. Payment can be canceled only if the current status is `scheduled`.
         - `chargeback` - payment was disputed and ruled against the lender. The payment was returned to the original payment instrument. Chargeback payment can be for partial amount.

        In order to create or update transactions to have status `inDispute` or
        `chargeback`, the `Create transaction chargeback` and `Update
        chargeback` endpoints should be used.
      enum:
        - scheduled
        - initiated
        - pending
        - succeeded
        - failed
        - canceled
      type: string
    BaseTransaction:
      allOf:
        - $ref: '#/components/schemas/BaseWithExternalIdMixin'
        - properties:
            achConfirmed:
              description: >
                Applies to ACH transactions processed by Peach. Set to `true`
                when the originating bank has confirmed receipt of the
                transaction.
              nullable: true
              readOnly: true
              type: boolean
            achProcessedSameDay:
              description: |
                The transaction was processed with ACH Same Day.
              nullable: true
              readOnly: true
              type: boolean
            achReturnCode:
              description: >-
                The ACH return code indicating the reason the transaction
                failed.
              maxLength: 5
              type: string
            achSameDay:
              description: >
                Attempt to process this transaction with ACH Same Day
                processing.
              nullable: true
              readOnly: true
              type: boolean
            actualAmount:
              description: |
                The actual amount that was processed. The system never debits
                more than the loan outstanding balance.
              format: float
              type: number
            avsResult:
              maxLength: 1
              minLength: 1
              type: string
            cancelLongDescription:
              description: |
                More detailed reason why the transaction was canceled.
              readOnly: true
              type: string
            cancelReason:
              $ref: '#/components/schemas/TransactionCancelReason'
            cancelShortDescription:
              description: |
                Brief reason why the transaction was canceled.
              readOnly: true
              type: string
            createdBy:
              $ref: '#/components/schemas/UserActionInfo'
              description: |
                Details of the user responsible for creating the transaction.
                Can be an borrower, agent, or automated system process.
            currency:
              description: Currency of the transaction.
              pattern: '[A-Z]{3}'
              type: string
            customDisplayName:
              description: >
                A friendly description of the transaction. If provided, this
                value will be displayed in Peach UI/App and Statements (or can
                be used by lender in their App). If the value is not provided,
                the Peach UI/App and Statements logic will render the
                transaction name based on type and status. Make sure you provide
                value that makes sense to the borrower.

                This is NOT what the borrower will see in their online bank or
                card account.
              nullable: true
              type: string
            failureDescriptionLong:
              description: >
                Detailed text describing the failure reason and any appropriate
                actions the user may take to fix the issue.
              readOnly: true
              type: string
            failureDescriptionShort:
              description: >
                Short text describing the failure reason. Normally displayed in
                UI.
              readOnly: true
              type: string
            failureReason:
              description: The transaction failure reason.
              enum:
                - insufficientFunds
                - chargeback
                - accountClosed
                - invalidAccount
                - unknownReason
                - invalidCvv
                - invalidExpirationDate
                - avsFailed
                - networkError
                - cardDeclined
                - accountFrozen
                - deceased
                - invalidRouting
                - paymentStopped
                - incorrectNumber
                - fraudulent
                - unauthorizedDebit
              type: string
            holdDaysEndDate:
              $ref: '#/components/schemas/HoldDaysEndDate'
            metaData:
              description: >-
                Store any type of key/value pairs in the form of a JSON
                dictionary.
              nullable: true
              type: object
            parentTransactionId:
              description: >-
                The ID of the real transactions that created this virtual
                transaction. Only relevant for virtual transactions.
              type: string
            paymentDetails:
              description: Payment details.
              properties:
                fromInstrument:
                  oneOf:
                    - properties:
                        accountNumberLastFour:
                          description: >
                            The last two, three or four digits of the account
                            number.

                            Normally, you should expect four digits. Two or
                            three digits are returned when four digits are not
                            available.
                          pattern: ^[0-9]{2,4}
                          readOnly: true
                          type: string
                        instrumentType:
                          enum:
                            - bankAccount
                          type: string
                      title: Bank Account
                      type: object
                    - properties:
                        cardNumberLastFour:
                          description: >
                            The last two, three or four digits of the card
                            number.

                            Normally, you should expect four digits. Two or
                            three digits are returned when four digits are not
                            available.
                          example: '1111'
                          pattern: ^[0-9]{2,4}
                          readOnly: true
                          type: string
                        cardType:
                          description: >-
                            The type of card. Requires permission
                            `payment.instrument:force`.
                          enum:
                            - credit
                            - debit
                          type: string
                        instrumentType:
                          enum:
                            - card
                          type: string
                      title: Card
                      type: object
                    - properties:
                        accountNumberLastFour:
                          description: >
                            The last two, three or four digits of the account
                            number.

                            Normally, you should expect four digits. Two or
                            three digits are returned when four digits are not
                            available.
                          pattern: ^[0-9]{2,4}
                          readOnly: true
                          type: string
                        checkNumber:
                          description: The check number
                          example: '1025'
                          readOnly: true
                          type: string
                        instrumentType:
                          enum:
                            - check
                          type: string
                        routingNumber:
                          description: The check routing number
                          example: '000000000'
                          readOnly: true
                          type: string
                      title: Check
                      type: object
                    - properties:
                        employerName:
                          description: The employer name
                          type: string
                        instrumentType:
                          enum:
                            - payroll
                          type: string
                      title: Payroll
                      type: object
                    - properties:
                        instrumentType:
                          enum:
                            - paymentNetwork
                          type: string
                        paymentNetworkMemberId:
                          description: >-
                            The borrower identifier in the payment network
                            system.
                          type: string
                        paymentNetworkName:
                          description: The payment network name
                          type: string
                      title: Payment Network
                      type: object
                    - properties:
                        instrumentType:
                          enum:
                            - wire
                          type: string
                        routingNumber:
                          description: The wire routing number
                          type: string
                        wireNumberLastFour:
                          description: >-
                            The last two, three or four digits of the wire
                            number. Normally, you should expect four digits. Two
                            or three digits are returned when four digits are
                            not available.
                          pattern: ^[0-9]{2,4}
                          readOnly: true
                          type: string
                      title: Wire
                      type: object
                    - properties:
                        instrumentType:
                          enum:
                            - moneyOrder
                          type: string
                        routingNumber:
                          description: The money order routing number
                          type: string
                        serialNumberLastFour:
                          description: >-
                            The last two, three or four digits of the money
                            order serial number. Normally, you should expect
                            four digits. Two or three digits are returned when
                            four digits are not available.
                          pattern: ^[0-9]{2,4}
                          type: string
                      title: Money Order
                      type: object
                fromInstrumentId:
                  description: The identifier of the payment instrument that was charged.
                  pattern: ^ext-|^\d+$
                  type: string
                reason:
                  description: The reason why the payment was created.
                  enum:
                    - autoPay
                    - oneTimePayment
                    - settlement
                    - reversal
                    - reimbursement
                  type: string
                toInstrument:
                  oneOf:
                    - properties:
                        accountNumberLastFour:
                          description: >
                            The last two, three or four digits of the account
                            number.

                            Normally, you should expect four digits. Two or
                            three digits are returned when four digits are not
                            available.
                          pattern: ^[0-9]{2,4}
                          readOnly: true
                          type: string
                        instrumentType:
                          enum:
                            - bankAccount
                          type: string
                      title: Bank Account
                      type: object
                    - properties:
                        accountNumberLastFour:
                          description: >
                            The last two, three or four digits of the account
                            number.

                            Normally, you should expect four digits. Two or
                            three digits are returned when four digits are not
                            available.
                          pattern: ^[0-9]{2,4}
                          readOnly: true
                          type: string
                        instrumentType:
                          enum:
                            - check
                          type: string
                      title: Check
                      type: object
                    - properties:
                        employerName:
                          description: The employer name
                          type: string
                        instrumentType:
                          enum:
                            - payroll
                          type: string
                      title: Payroll
                      type: object
                    - properties:
                        instrumentType:
                          enum:
                            - paymentNetwork
                          type: string
                        paymentNetworkMemberId:
                          description: >-
                            The borrower identifier in the payment network
                            system.
                          type: string
                        paymentNetworkName:
                          description: The payment network name
                          type: string
                      title: Payment Network
                      type: object
                    - properties:
                        instrumentType:
                          enum:
                            - wire
                          type: string
                        routingNumber:
                          description: The wire routing number
                          type: string
                        wireNumberLastFour:
                          description: >
                            The last two, three or four digits of the wire
                            number.

                            Normally, you should expect four digits. Two or
                            three digits are returned when four digits are not
                            available.
                          pattern: ^[0-9]{2,4}
                          readOnly: true
                          type: string
                      title: Wire
                      type: object
                    - properties:
                        instrumentType:
                          enum:
                            - moneyOrder
                          type: string
                        routingNumber:
                          description: The money order routing number
                          type: string
                        serialNumberLastFour:
                          description: >
                            The last two, three or four digits of the money
                            order serial number.

                            Normally, you should expect four digits. Two or
                            three digits are returned when four digits are not
                            available.
                          pattern: ^[0-9]{2,4}
                          type: string
                      title: Money Order
                      type: object
                toInstrumentId:
                  description: The identifier of the payment instrument that was credited.
                  pattern: ^ext-|^\d+$
                  type: string
                type:
                  description: The payment type.
                  enum:
                    - ach
                    - debitCard
                    - creditCard
                    - check
                    - cash
                    - payroll
                    - paymentNetwork
                    - moneyOrder
                    - wire
                  type: string
              type: object
            processingFeeAmount:
              description: >-
                Transaction processing fees that are charged by a payment
                processor.
              type: number
            processingFeeType:
              description: >
                Describes whether the processing fees are net or gross.

                If it is a net fee, the amount of the fee is deducted from the
                amount of the transaction 'en route'.

                If it is a gross fee, the amount of the fee is charged by the
                processor at the end the month.
              enum:
                - net
                - gross
              type: string
            processorFailureDetails:
              description: The error details returned by the payment processor.
            processorFailureReason:
              description: The raw failure reason returned by the payment processor.
              type: string
            processorMerchantId:
              description: >
                Applies to card transactions processed by Peach. The merchant ID
                used for processing a card transaction.
              nullable: true
              readOnly: true
              type: string
            processorReconciliationId:
              type: string
            processorReversalId:
              type: string
            processorTransactionId:
              type: string
            retryAttempt:
              description: |
                Number of attempts to retry processing a failed transaction.
              nullable: true
              type: integer
            retryOriginalTransactionId:
              description: >
                The Peach identifier for the original transaction for which this
                is a retry.
              nullable: true
              readOnly: true
              type: string
            reversedAmount:
              description: >
                The total amount of reversals associated with this transaction.
                See `reversedByTransactionIds` for reversal transaction details.

                This amount is calculated by Peach and cannot be set or updated
                via API.
              format: float
              readOnly: true
              type: number
            reversedByTransactionExternalId:
              description: >
                **DEPRECATED ATTRIBUTE** Use `reversedByTransactionIds` to
                obtain external IDs of all reversing transactions


                Lender's external identifier of the transaction that reverses
                this one.
              pattern: ^ext-|^\d+$
              readOnly: true
              type: string
            reversedByTransactionId:
              description: >
                **DEPRECATED ATTRIBUTE** Use `reversedByTransactionIds` to
                obtain IDs of all reversing transactions.


                Peach identifier of the transaction that reverses this one.
              readOnly: true
              type: string
            reversedByTransactionIds:
              description: Identifier(s) of the transaction(s) that reverse this one
              items:
                properties:
                  externalId:
                    description: >-
                      Lender's external identifier of the transaction that
                      reverses this one.
                    pattern: ^ext-|^\d+$
                    type: string
                  id:
                    description: Peach identifier of the transaction that reverses this one
                    type: string
                type: object
              readOnly: true
              type: array
            reversesTransactionExternalId:
              description: >-
                The `externalId` of the original transaction that is being fully
                or partially reversed by this transaction.
              readOnly: true
              type: string
            reversesTransactionId:
              description: >-
                The `id` of the original transaction that is being fully or
                partially reversed by this transaction.
              readOnly: true
              type: string
            scheduledAmount:
              description: >
                The scheduled amount. The actual amount charged can be lower
                from the

                scheduled amount. It cannot be higher.
              format: float
              type: number
            status:
              $ref: '#/components/schemas/TransactionStatus'
            timestamps:
              description: Timestamps of the transaction statuses.
              properties:
                appliedAt:
                  description: >
                    The effective date and time the transaction was applied to
                    the loan.

                    This matches the effective date and time of the ledger
                    entries resulting from applying the transaction.

                    If this value is null, the transaction has not been applied.
                  format: date-time
                  readOnly: true
                  type: string
                canceledAt:
                  description: >
                    The date and time the transaction transitioned to the
                    `canceled` status.

                    See `status` for more information.
                  format: date-time
                  type: string
                chargebackAt:
                  description: >
                    The date and time the transaction transitioned to the
                    `chargeback` status.

                    See `status` for more information.
                  format: date-time
                  type: string
                createdAt:
                  description: |
                    The date and time the transaction was created.
                  format: date-time
                  readOnly: true
                  type: string
                deletedAt:
                  description: >
                    If this field is not null, the transaction is considered
                    deleted. The date and time the transaction was deleted.
                  format: date-time
                  nullable: true
                  readOnly: true
                  type: string
                displayDate:
                  description: >
                    The display date of the transaction in the product timezone.

                    This determines the placement of the transaction on the
                    timeline displayed in the borrower portal.

                    In some instances, this will differ from the `effectiveDate`
                    of the transaction. For example, when a reversal transaction
                    is created,

                    the `effectiveDate` of the reversal matches the original
                    transaction, but the `displayDate` of the reversal is the
                    date on which the reversal was processed.
                  format: date
                  type: string
                effectiveDate:
                  description: >-
                    The effective date of the transaction in the product
                    timezone. Updated when a transaction is backdated.
                  format: date
                  type: string
                failedAt:
                  description: >
                    The date and time the transaction transitioned to the
                    `failed` status.

                    See `status` for more information.
                  format: date-time
                  type: string
                inDisputeAt:
                  description: >
                    The date and time the transaction transitioned to the
                    `inDispute` status.

                    See `status` for more information.
                  format: date-time
                  type: string
                initiatedAt:
                  description: >
                    The date and time the transaction transitioned to the
                    `initiated` status.

                    See `status` for more information.
                  format: date-time
                  type: string
                originalDisplayDate:
                  format: date
                  readOnly: true
                  type: string
                originalEffectiveDate:
                  description: >-
                    The original effective date of the transaction in the
                    product timezone, prior to any backdating of the
                    transaction.
                  format: date
                  readOnly: true
                  type: string
                pendingAt:
                  description: >
                    The date and time the transaction transitioned to the
                    `pending` status.

                    See `status` for more information.
                  format: date-time
                  type: string
                scheduledDate:
                  description: >
                    The scheduled date of the transaction in the product
                    timezone.

                    Transactions to be processed by peach will be processed on
                    this date.
                  format: date
                  type: string
                succeededAt:
                  description: >
                    The date and time the transaction transitioned to the
                    `succeeded` status.

                    See `status` for more information.
                  format: date-time
                  type: string
                updatedAt:
                  description: |
                    The date and time the transaction was last updated.
                  format: date-time
                  nullable: true
                  readOnly: true
                  type: string
              type: object
            transactionType:
              description: >
                The transaction type.


                `payment` - payment made by the borrower or by a service agent
                per borrower request.

                Can be one-time payment, future payment or Autopay.

                Successful payments reduce loan balance.


                `serviceCredit` - service credit issued by a service agent or
                supervisor. Successful service

                credits reduce loan balance.
              enum:
                - payment
                - serviceCredit
              type: string
          type: object
      title: Transaction
    ChargebackStatus:
      default: open
      description: >
        The status of the chargeback.
          - `open` -  the chargeback was opened and is currently in dispute. The system assumes that the chargeback amount is temporarily taken and the
            `effectiveAmount` of the transaction is reduced by the chargeback amount. This might trigger a replay.
          - `closed` - the chargeback dispute period has closed, and the chargeback has been upheld. This is a terminal state and the chargeback cannot
            be reopened. The system assumes that the chargeback amount is permanently taken and the `effectiveAmount` of the transaction is reduced.
          - `reversed` - the chargeback dispute period has closed, and the chargeback has been reversed. The system assumes that the chargeback amount
            is permanently returned and the `effectiveAmount` of the transaction is increased back. This might trigger a replay.

        The chargeback status impacts the transaction status is the following
        way:


        For a transaction with a single chargeback, the chargeback status
        dictates the transaction status:
          - chargeback`status:open` → transaction `status:inDispute`
          - chargeback`status:closed` → transaction `status:chargeback`
          - chargeback`status:reversed` → transaction `status:succeeded`

        For a transaction with multiple chargebacks, the following logic
        applied:
          - Any of the chargebacks in `status:open` → transaction `status:inDispute`
          - No chargebacks are in `status:open`, and any chargebacks are in `status:closed` → transaction `status:chargeback`
          - All chargebacks are in `status:reversed`→ transaction `status:succeeded`
      enum:
        - open
        - closed
        - reversed
      type: string
    Chargeback:
      properties:
        amount:
          description: >-
            The amount of the chargeback. Defaults to the `actualAmount` of the
            transaction.
          format: float
          type: number
        caseId:
          description: The identifier of an existing case.
          type: string
        category:
          description: The chargeback category as received from the payment processor.
          type: string
        description:
          description: >-
            The description of the chargeback as received from the payment
            processor.
          type: string
        externalCaseNumber:
          description: >-
            The external case number of the chargeback in the payment processor
            system.
          type: string
        externalId:
          description: The lender's identifier of the chargeback.
          readOnly: true
          type: string
        id:
          description: The identifier of the chargeback.
          readOnly: true
          type: string
        reasonCode:
          description: The reason code as received from the payment processor.
          type: string
        status:
          $ref: '#/components/schemas/ChargebackStatus'
      type: object
    serviceCreditTypes:
      description: >
        The type of service credit.


        - `serviceAgent`, `serviceSupervisor` - can be used when a lender
        provides a service credit as a courtesy to a borrower. 

        Note: this type of credit is reported to credit bureaus in Metro2 as
        "Actual Payment Amount" and "Date of Last Payment".


        - `balanceTransfer` - can be used when you need to transfer balance from
        an existing loan or draw to a new one. 

        Note: this type of credit is reported to credit bureaus in Metro2 as
        "Actual Payment Amount" and "Date of Last Payment".


        - `usuryCap` - can be used by a lender in case interest or fees exceed
        usury caps. Note: this type of credit is reported to 

        credit bureaus in Metro2 as "Actual Payment Amount" and "Date of Last
        Payment".


        - `rewards` - can be used by a lender to convert rewards to a service
        credit to pay down outstanding balance. Note: this 

        type of credit is reported to credit bureaus in Metro2 as "Actual
        Payment Amount" and "Date of Last Payment".


        - `settlementOfDebt` - can be used when a lender settles outstanding
        balance with a borrower as part of collection efforts. 
          Please read carefully the difference between the `settlementOfDebt` and `settlementOfDebtNoLoss` descriptions.
          
          Notes:

          - This type of credit is NOT reported to credit bureaus in Metro2 as "Actual Payment Amount" and "Date of Last Payment".
          - This type of credit is considered as "loss" in Metro2 logic of "Account Status" Base Segment field. A charged off loan with
            outstanding balance of zero and `settlementOfDebt` service credit will be reported as Account Status=97.

        - `settlementOfDebtNoLoss` - can be used when a lender settles
        outstanding balance with a borrower as part of collection efforts.
          Please read carefully the difference between the `settlementOfDebt` and `settlementOfDebtNoLoss` descriptions.
          
          Notes:
           - This type of credit is NOT reported to credit bureaus in Metro2 as "Actual Payment Amount" and "Date of Last Payment".
           - This type of credit is NOT considered as "loss" in Metro2 logic of "Account Status" Base Segment field. A charged off loan 
             with outstanding balance of zero and `settlementOfDebtNoLoss` service credit (assuming no service credits of type `settlementOfDebt`, `fraud`, `badDebt` or `deceased` exist) will be reported as Account Status=64.

        - `fraud` - can be used when a lender confirms that a loan is fraudulent
        and wants to bring the loan balance to zero.
          
          Notes:
            - This type of credit is NOT reported to credit bureaus in Metro2 as "Actual Payment Amount" and "Date of Last Payment".
            - This type of credit is considered as "loss" in Metro2 logic of "Account Status" Base Segment field.

        - `badDebt` - can be used after a loan is charged off and the lender
        wants to write off the balance and make the loan balance zero.
          
          Notes:
            - This type of credit is NOT reported to credit bureaus in Metro2 as "Actual Payment Amount" and "Date of Last Payment".
            - This type of credit is considered as "loss" in Metro2 logic of "Account Status" Base Segment field.

        - `deceased` - can be used when a lender confirms a deceased case.
          
          Notes:
            - This type of credit is NOT reported to credit bureaus in Metro2 as "Actual Payment Amount" and "Date of Last Payment".
            - This type of credit is considered as "loss" in Metro2 logic of "Account Status" Base Segment field.

        - `bankruptcy` - should only be used when a bankruptcy case is
        discharged and the lender wants to bring the loan balance to zero.
          
          Notes:
            - This type of credit is NOT reported to credit bureaus in Metro2 as "Actual Payment Amount" and "Date of Last Payment".
            - This type of credit is used in the Metro2 logic of "Account Status" Base Segment field to report Account Status=64.

        - `rounding` - this type of service credit can be created by the Peach
        system only. 


        - `refund` - this type of service credit can be created by the Peach
        system only. 


        - `interestAdjustment` - this type of service credit can be created by
        the Peach system only. 
      enum:
        - serviceAgent
        - serviceSupervisor
        - settlementOfDebt
        - settlementOfDebtNoLoss
        - balanceTransfer
        - rewards
        - fraud
        - badDebt
        - bankruptcy
        - deceased
        - usuryCap
        - refund
        - interestAdjustment
        - rounding
      type: string
    NormalTransaction:
      allOf:
        - $ref: '#/components/schemas/BaseTransaction'
        - properties:
            chargebackAmount:
              description: >
                The total amount of all Open and Closed chargebacks on this
                transaction.
              format: float
              nullable: true
              readOnly: true
              type: number
            chargebackDetails:
              items:
                $ref: '#/components/schemas/Chargeback'
              readOnly: true
              type: array
            effectiveAmount:
              description: >
                The net/effective amount of the transaction after taking into
                account chargebacks, reversals, and disputes. The amount is
                calculated as:

                `effectiveAmount = actualAmount - reversedAmount -
                chargebackAmount`

                This amount is calculated by Peach and cannot be set or updated
                via API.
              format: float
              readOnly: true
              type: number
            isExternal:
              type: boolean
            isVirtual:
              type: boolean
            paidFeesAmount:
              format: float
              type: number
            paidInterestAmount:
              format: float
              type: number
            paidOverAmount:
              format: float
              type: number
            paidPrincipalAmount:
              format: float
              type: number
            serviceCreditDetails:
              description: Information about credit.
              properties:
                reason:
                  description: The reason why the payment was created.
                  enum:
                    - oneTimePayment
                    - reversal
                  type: string
                sponsor:
                  description: >
                    Sponsor of the credit. Mainly used for ledger/accounting.


                    If `loanOwner`, the credit is recorded as expense in
                    ledger/accounting.


                    If `loanServicer`, the credit is recorded as liability from
                    the servicer.


                    If `merchant`, the credit is recorded as liability from the
                    merchant.
                  enum:
                    - loanOwner
                    - loanServicer
                    - merchant
                  type: string
                type:
                  allOf:
                    - $ref: '#/components/schemas/serviceCreditTypes'
                    - description: >-
                        Type of the credit. Credit types are recorded
                        differently in ledger/accounting.
              type: object
          type: object
    Transaction:
      allOf:
        - $ref: '#/components/schemas/NormalTransaction'
        - properties:
            autopayPaymentIds:
              description: Peach identifiers of the autopay expected payments.
              items:
                type: integer
              type: array
            autopayPlanId:
              description: Peach identifier of the autopay plan.
              type: string
            consentDocumentId:
              allOf:
                - $ref: '#/components/schemas/AnyId'
                - writeOnly: false
                - description: >
                    The document ID of a one-time payment consent given by the

                    borrower to debit their payment instrument.  The document is

                    stored in the HTML format and contains the disclosure shown
                    to

                    the borrower at the time of the payment.  Required if

                    `previewMode=false` and Peach is processing payments (aka

                    `isExternal=false`) on behalf of the lender.
            drawId:
              description: |
                The draw identifier for the transaction.
              type: string
            enablePrepayments:
              description: >
                **DEPRECATED ATTRIBUTE**

                `true` if the borrower opts to apply any overpayment amount to
                prepayment of future obligations.

                `false` if the borrower opts to apply overpayments to the
                current obligation.


                If this field is not passed, we reference the `allowPrepayments`
                configuration on the loan type.
              type: boolean
            evidenceDocumentId:
              allOf:
                - $ref: '#/components/schemas/AnyId'
                - writeOnly: false
                - description: >
                    The document ID of a one-time payment consent screenshot

                    captured when a borrower made the payment.  Only applicable
                    when

                    Peach App is used and company's

                    `config.evidence.captureScreenshot=true`.
            initiatingBorrowerId:
              description: |
                The ID of the borrower who initiated the transaction.
              nullable: true
              type: string
            isExternal:
              description: >
                A transaction marked `isExternal=true` is for record purposes
                only. A transaction with

                an external `paymentInstrument` is automatically marked
                external.
            isVirtual:
              description: >
                A transaction marked `isVirtual=true` is not a real transaction,
                but represents a part of another transaction.

                This is used to store the principal/interest split on draws in
                Line of Credits as well as splits between multiple

                installment loans that were applied as a single payment.
            loanId:
              description: |
                The unique identifier of the Loan.
              type: string
            mainBorrowerId:
              description: |
                The Peach identifier for the main borrower on the loan.
              type: string
            paidFeesAmount:
              description: |
                The paid rounded amount allocated to fees
            paidInterestAmount:
              description: |
                The paid rounded amount allocated to interest
            paidOverAmount:
              description: >
                Stores any excess rounded amount that was not allocated to
                principal, interest or fees.
            paidPrincipalAmount:
              description: |
                The paid rounded amount allocated to principal
            unroundedPaidFeesAmount:
              description: |
                The paid unrounded amount allocated to fees
              format: float
              type: number
            unroundedPaidInterestAmount:
              description: |
                The paid unrounded amount allocated to interest
              format: float
              type: number
            unroundedPaidOverAmount:
              description: >
                Stores any excess unrounded amount that was not allocated to
                principal, interest or fees.
              format: float
              type: number
            unroundedPaidPrincipalAmount:
              description: |
                The paid unrounded amount allocated to principal
              format: float
              type: number
          type: object
    ContextVarLoanDataSource:
      allOf:
        - $ref: '#/components/schemas/Loan'
        - properties:
            autopayData:
              description: Autopay payment information. (Schema TBD)
              type: object
            balances:
              $ref: '#/components/schemas/Balances'
            creditReporting:
              description: Credit reporting data
              properties:
                creditAgencies:
                  items:
                    properties:
                      agencyName:
                        description: Name of the credit agency
                        type: string
                      reportingStartDate:
                        description: Date the loan started reporting to the agency
                        format: date
                        type: string
                    type: object
                  type: array
                isReporting:
                  type: boolean
              type: object
            daysOverdue:
              description: Number of days the loan is overdue
              type: integer
            daysToChargeOff:
              description: Number of days to charge off the loan
              type: integer
            futureBalances:
              $ref: '#/components/schemas/FutureBalances'
            investors:
              description: List of loan investors. (Schema TBD)
              items:
                type: object
              type: array
            loanType:
              $ref: '#/components/schemas/LoanType'
            overdueAmount:
              description: Amount overdue
              type: integer
            overdueSummary:
              description: Summary of overdue information
              properties:
                daysOverdue:
                  description: Number of days the loan is overdue
                  type: integer
                isOverdue:
                  description: Is the loan overdue
                  type: boolean
                overdueAmount:
                  description: Amount overdue
                  type: integer
              type: object
            people:
              description: List of people associated with the loa
              items:
                $ref: '#/components/schemas/Borrower'
              type: array
            transactions:
              items:
                $ref: '#/components/schemas/Transaction'
              type: array
          type: object
    ContextVarPaymentAmount:
      description: The amount of the payment
      multipleOf: 0.01
      type: number
    ContextVarPaymentDueDate:
      description: The due date of the payment
      format: date
      type: string
    ContextVarPaymentMethod:
      description: The payment method
      enum:
        - bankAccount
        - card
        - check
        - payroll
        - paymentNetwork
        - moneyOrder
        - wire
      type: string
    ContextVarPaymentMethodLastFour:
      description: The last four digits of the payment method
      type: string
    ContextVarPerson:
      allOf:
        - $ref: '#/components/schemas/Borrower'
        - properties:
            address:
              $ref: '#/components/schemas/Address'
          type: object
    AvailableTemplateContextSubjectAutopayAmountChanged:
      description: >
        ### Sent When

        - Trigger: Autopay amount increased more then X%

        - When: 9am PST
          
        The context variables included by system when it sends
        `autopayAmountChanged`
      properties:
        company:
          $ref: '#/components/schemas/Company'
        extraCharge:
          description: |
            The additional charge above the original autopay amount.
          type: number
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        paymentAmount:
          $ref: '#/components/schemas/ContextVarPaymentAmount'
        paymentDueDate:
          $ref: '#/components/schemas/ContextVarPaymentDueDate'
        paymentMethod:
          $ref: '#/components/schemas/ContextVarPaymentMethod'
        paymentMethodLastFour:
          $ref: '#/components/schemas/ContextVarPaymentMethodLastFour'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: autopayAmountChanged
      type: object
      x-tags:
        - System Sent Messages
    AutopayCancelReason:
      description: Why the autopay was canceled.
      enum:
        - invalidPaymentMethod
        - paymentMethodRemoved
        - tooManyFailedAttempts
        - loanFrozen
        - loanAccelerated
        - loanChargedOff
        - loanPaidOff
        - canceledByUser
        - loanTermsChanged
      nullable: true
      type: string
    AvailableTemplateContextSubjectAutopayCanceledBySystem:
      description: >
        ### Sent When

        - Trigger: Autopay was canceled by the system because payment instrument
        became invalid or loan terms changed.

        - When: Immediately
          
        The context variables included by system when it sends
        `autopayCanceledBySystem`
      properties:
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        paymentMethod:
          $ref: '#/components/schemas/ContextVarPaymentMethod'
        paymentMethodLastFour:
          $ref: '#/components/schemas/ContextVarPaymentMethodLastFour'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
        reason:
          $ref: '#/components/schemas/AutopayCancelReason'
      title: autopayCanceledBySystem
      type: object
      x-tags:
        - System Sent Messages
    ContextVarPaymentSchedule:
      description: The dates and amounts of payments to be made
      items:
        properties:
          amount:
            type: number
          date:
            format: date
            type: string
        type: object
      type: array
    AvailableTemplateContextSubjectAutopayEnabled:
      description: |
        ### Sent When
        - Trigger: Borrower or agent turned on Autopay.
        - When: Immediately
          
        The context variables included by system when it sends `autopayEnabled`
      properties:
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        paymentMethod:
          $ref: '#/components/schemas/ContextVarPaymentMethod'
        paymentMethodLastFour:
          $ref: '#/components/schemas/ContextVarPaymentMethodLastFour'
        paymentSchedule:
          $ref: '#/components/schemas/ContextVarPaymentSchedule'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: autopayEnabled
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectAutopayEnableReminder:
      description: >
        ### Sent When

        - Trigger: Borrower has not enabled autopay X days before the due date.

        - When: 9am PST
          
        The context variables included by system when it sends
        `autopayEnableReminder`
      properties:
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        nextDueDate:
          description: The due date of the next payment.
          format: date
          type: string
        paymentDays:
          description: The number of days to the due date.
          type: integer
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: autopayEnableReminder
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectAutopayPaymentCanceled:
      description: >
        ### Sent When

        - Trigger: Autopay scheduled payment was canceled (eg: due to low
        balance per Plaid check)

        - When: 1-2am Product Timezone
          
        The context variables included by system when it sends
        `autopayPaymentCanceled`
      properties:
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        paymentAmount:
          $ref: '#/components/schemas/ContextVarPaymentAmount'
        paymentDate:
          $ref: '#/components/schemas/ContextVarPaymentDueDate'
        paymentMethod:
          $ref: '#/components/schemas/ContextVarPaymentMethod'
        paymentMethodLastFour:
          $ref: '#/components/schemas/ContextVarPaymentMethodLastFour'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: autopayPaymentCanceled
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectAutopayPaymentMethodUpdated:
      description: >
        ### Sent When

        - Trigger: Borrower or agent updated payment method on an existing
        Autopay plan.

        - When: Immediately
          
        The context variables included by system when it sends
        `autopayPaymentMethodUpdated`
      properties:
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        paymentMethod:
          $ref: '#/components/schemas/ContextVarPaymentMethod'
        paymentMethodLastFour:
          $ref: '#/components/schemas/ContextVarPaymentMethodLastFour'
        paymentSchedule:
          $ref: '#/components/schemas/ContextVarPaymentSchedule'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: autopayPaymentMethodUpdated
      type: object
      x-tags:
        - System Sent Messages
    ContextVarExpectedPaymentIds:
      description: >-
        The IDs of the expected payments objects representing payments not yet
        made.
      items:
        example: XP-L9BN-5J52
        type: string
      type: array
    ContextVarOverdueAmount:
      description: The overdue amount
      multipleOf: 0.01
      type: number
    AvailableTemplateContextSubjectAutopayPaymentReminder:
      description: >
        ### Sent When

        - Trigger: Autopay payment reminder sent X days before the Autopay date,
        sent when autopay is on.

        - When: 9am PST
          
        The context variables included by system when it sends
        `autopayPaymentReminder`
      properties:
        company:
          $ref: '#/components/schemas/Company'
        expectedPaymentIds:
          $ref: '#/components/schemas/ContextVarExpectedPaymentIds'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        overdueAmount:
          $ref: '#/components/schemas/ContextVarOverdueAmount'
        paymentAmount:
          $ref: '#/components/schemas/ContextVarPaymentAmount'
        paymentDate:
          $ref: '#/components/schemas/ContextVarPaymentDueDate'
        paymentMethod:
          $ref: '#/components/schemas/ContextVarPaymentMethod'
        paymentMethodLastFour:
          $ref: '#/components/schemas/ContextVarPaymentMethodLastFour'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: autopayPaymentReminder
      type: object
      x-tags:
        - System Sent Messages
    ContextVarNewPaymentDate:
      description: The new payment date
      format: date
      type: string
    ContextVarOldPaymentDate:
      description: The old payment date
      format: date
      type: string
    AvailableTemplateContextSubjectAutopayPaymentRescheduled:
      description: >
        ### Sent When

        - Trigger: Autopay scheduled payment was rescheduled (eg: due to low
        balance per Plaid check).

        - When: 1-2am Product Timezone
          
        The context variables included by system when it sends
        `autopayPaymentRescheduled`
      properties:
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        newPaymentDate:
          $ref: '#/components/schemas/ContextVarNewPaymentDate'
        oldPaymentDate:
          $ref: '#/components/schemas/ContextVarOldPaymentDate'
        paymentAmount:
          $ref: '#/components/schemas/ContextVarPaymentAmount'
        paymentMethod:
          $ref: '#/components/schemas/ContextVarPaymentMethod'
        paymentMethodLastFour:
          $ref: '#/components/schemas/ContextVarPaymentMethodLastFour'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: autopayPaymentRescheduled
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectCardExpiresReminder:
      description: >
        ### Sent When

        - Trigger: Card payment method is expiring soon.

        - When: 9am PST
          
        The context variables included by system when it sends
        `cardExpiresReminder`
      properties:
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        month:
          description: >-
            The full name of the month the card expires (e.g., October, not
            Oct).
          type: string
        paymentMethod:
          $ref: '#/components/schemas/ContextVarPaymentMethod'
        paymentMethodLastFour:
          $ref: '#/components/schemas/ContextVarPaymentMethodLastFour'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
        year:
          description: The year the card expires.
          type: integer
      title: cardExpiresReminder
      type: object
      x-tags:
        - System Sent Messages
    ContextVarCase:
      allOf:
        - $ref: '#/components/schemas/Case'
        - properties:
            associatedLoanIds:
              description: |
                The IDs of the loans associated with this case.
              type: string
            associatedLoans:
              description: |
                The loans associated with this case.
              items:
                $ref: '#/components/schemas/ContextVarLoanDataSource'
              type: array
            isReportingAssociatedLoans:
              description: >
                If any of the associated loans are reporting to credit agencies
                (`isReporting=true` in the API),

                this will be `true`.
              type: boolean
          type: object
    AvailableTemplateContextSubjectCeaseCommunicationAcknowledgement:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM associated with Cease
        Communications Case Type)

        - When: Immediately
          
        The context variables included by system when it sends
        `ceaseCommunicationAcknowledgement`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: ceaseCommunicationAcknowledgement
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectCeaseRefuseToPay:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM associated with Cease
        Communications Case Type)

        - When: Immediately
          
        The context variables included by system when it sends
        `ceaseCommunicationRefuseToPay`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: ceaseCommunicationRefuseToPay
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectConfirmationCode:
      description: >
        ### Sent When

        - Trigger: Manual (One time verification code sent to verify email or
        phone ownership.)

        - When: Immediately
          
        The context variables included by system when it sends
        `confirmationCode`
      properties:
        company:
          $ref: '#/components/schemas/Company'
        confirmationCode:
          description: The confirmation code to be sent.
          maxLength: 6
          minLength: 6
          type: string
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: confirmationCode
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectContactTakeover:
      description: |
        ### Sent When
        - Trigger: Another borrower "claimed" email or phone number.
        - When: Immediately
          
        The context variables included by system when it sends `contactTakeover`
      properties:
        company:
          $ref: '#/components/schemas/Company'
        contactType:
          description: |
            The type of contact that was taken over. Only email and phone
            can be taken over.
          enum:
            - email
            - phone
          type: string
        emailMasked:
          description: |
            The email address of the phone number which was taken over,
            with most of the characters replaced with `*`.
          type: string
        person:
          $ref: '#/components/schemas/ContextVarPerson'
        phoneNumberLastFour:
          description: The last four digits of the phone number which was taken over.
          maxLength: 4
          minLength: 4
          type: string
      title: contactTakeover
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectCustomX:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM, once configured.)

        - When: Immediately
          
        The context variables included by system when it sends `customX`
        (`custom1` - `custom100`)
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: customX
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectDebtValidationNotice:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM when a new loan is created.)

        - When: Immediately
          
        The context variables included by system when it sends
        `debtValidationNotice`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: debtValidationNotice
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectDebtValidationNoticeArizona:
      description: >
        ### Sent When

        - Trigger: Can be configured on loan type to be sent upon loanActivation
        or loanFirstOverdue.

        - When: Immediately
          
        The context variables included by system when it sends
        `debtValidationNoticeArizona`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: debtValidationNoticeArizona
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectDebtValidationNoticeAutomatic:
      description: >
        ### Sent When

        - Trigger: Can be configured on loan type to be sent upon loanActivation
        or loanFirstOverdue.

        - When: Immediately
          
        The context variables included by system when it sends
        `debtValidationNoticeAutomatic`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: debtValidationNoticeAutomatic
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectDebtValidationNoticeNYCYonkers:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM when a new loan is created.)

        - When: Immediately
          
        The context variables included by system when it sends
        `debtValidationNoticeNYCYonkers`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: debtValidationNoticeNYCYonkers
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectDebtValidationNoticePuertoRico:
      description: >
        ### Sent When

        - Trigger: Can be configured on loan type to be sent upon loanActivation
        or loanFirstOverdue.

        - When: Immediately
          
        The context variables included by system when it sends
        `debtValidationNoticePuertoRico`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: debtValidationNoticePuertoRico
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectDeceasedConfirmationOfPayoff:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM with an associated Deceased
        Case.)

        - When: Immediately
          
        The context variables included by system when it sends
        `deceasedConfirmationOfPayoff`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: deceasedConfirmationOfPayoff
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectDeceasedNoticeToRepresentative:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM with an associated Deceased
        Case.)

        - When: Immediately
          
        The context variables included by system when it sends
        `deceasedNoticeToRepresentative`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: deceasedNoticeToRepresentative
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectDeceasedNotificationUponDeath:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM with an associated Deceased
        Case.)

        - When: Immediately
          
        The context variables included by system when it sends
        `deceasedNotificationUponDeath`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: deceasedNotificationUponDeath
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectDisputeOfDebtSubmitDocumentation:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM with an associated Dispute Of
        Debt Case.)

        - When: Immediately
          
        The context variables included by system when it sends
        `disputeOfDebtSubmitDocumentation`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: disputeOfDebtSubmitDocumentation
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectDisputeOfDebtConfirmed:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM with an associated Dispute Of
        Debt Case.)

        - When: Immediately
          
        The context variables included by system when it sends
        `disputeOfDebtConfirmed`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: disputeOfDebtConfirmed
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectDisputeOfDebtSubmitDocumentationReminder:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM with an associated Dispute Of
        Debt Case.)

        - When: Immediately
          
        The context variables included by system when it sends
        `disputeOfDebtSubmitDocumentationReminder`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: disputeOfDebtSubmitDocumentationReminder
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectDisputeOfDebtUnableToConfirm:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM with an associated Dispute Of
        Debt Case.)

        - When: Immediately
          
        The context variables included by system when it sends
        `disputeOfDebtUnableToConfirm`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: disputeOfDebtUnableToConfirm
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectDisputeOfDebtUnableToResolve:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM with an associated Dispute Of
        Debt Case.)

        - When: Immediately
          
        The context variables included by system when it sends
        `disputeOfDebtUnableToResolve`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: disputeOfDebtUnableToResolve
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectElectronicConsentOptOut:
      description: >
        ### Sent When

        - Trigger: System (Agent revoked consent to electronic communication per
        borrower request.)

        - When: Immediately
          
        The context variables included by system when it sends
        `electronicConsentOptOut`
      properties:
        company:
          $ref: '#/components/schemas/Company'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: electronicConsentOptOut
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectFailedSettlementInvestor:
      description: >
        ### Sent When

        - Trigger: System (Settlement of funds failed.)

        - When: Immediately
          
        The context variables included by system when it sends
        `failedSettlementInvestor`
      properties:
        company:
          $ref: '#/components/schemas/Company'
        companyName:
          description: The name of the company.
          type: string
        investorContactName:
          description: The name of the investor.
          type: string
        paymentMethod:
          $ref: '#/components/schemas/ContextVarPaymentMethod'
        paymentMethodLastFour:
          $ref: '#/components/schemas/ContextVarPaymentMethodLastFour'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: failedSettlementInvestor
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectFreeFormBranded:
      description: |
        ### Sent When
        - Trigger: Manual (Agent can send via CRM.)
        - When: Immediately
          
        The context variables included by system when it sends `freeFormBranded`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: freeFormBranded
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectFuturepayCanceled:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM.)

        - When: Immediately
          
        The context variables included by system when it sends
        `futurepayCanceled`
      properties:
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: futurepayCanceledf
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectFuturepayPaymentDueReminder:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM.)

        - When: 9am PST
          
        The context variables included by system when it sends
        `futurepayPaymentDueReminder`
      properties:
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: futurepayPaymentDueReminder
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectIdentityTheftIncompleteDocumentation:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM associated with Identity Theft
        Case Type)

        - When: Immediately
          
        The context variables included by system when it sends
        `identityTheftIncompleteDocumentation`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: identityTheftIncompleteDocumentation
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectIdentityTheftSubmitDocumentationFirstReminder:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM associated with Identity Theft
        Case Type)

        - When: Immediately
          
        The context variables included by system when it sends
        `identityTheftSubmitDocumentationFirstReminder`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: identityTheftSubmitDocumentationFirstReminder
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectIdentityTheftSubmitDocumentation:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM associated with Identity Theft
        Case Type)

        - When: Immediately
          
        The context variables included by system when it sends
        `identityTheftSubmitDocumentation`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: identityTheftSubmitDocumentation
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectIdentityTheftSubmitDocumentationSecondReminder:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM associated with Identity Theft
        Case Type)

        - When: Immediately
          
        The context variables included by system when it sends
        `identityTheftSubmitDocumentationSecondReminder`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: identityTheftSubmitDocumentationSecondReminder
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectIdentityTheftValidated:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM associated with Identity Theft
        Case Type)

        - When: Immediately
          
        The context variables included by system when it sends
        `identityTheftValidated`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: identityTheftValidated
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectIdentityTheftNotValidated:
      description: >
        ### Sent When

        - Trigger: Manual (Agent can send via CRM associated with Identity Theft
        Case Type)

        - When: Immediately
          
        The context variables included by system when it sends
        `identityTheftNotValidated`
      properties:
        case:
          $ref: '#/components/schemas/ContextVarCase'
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: identityTheftNotValidated
      type: object
      x-tags:
        - System Sent Messages
    AvailableTemplateContextSubjectAutopayAgreement:
      description: >
        ### Displayed When

        Autopay agreement shown to a borrower when they turn on Autopay.
          
        The context variables included by system when it displays
        `autopayAgreement`
      properties:
        company:
          $ref: '#/components/schemas/Company'
        loan:
          $ref: '#/components/schemas/ContextVarLoanDataSource'
        paymentMethod:
          $ref: '#/components/schemas/ContextVarPaymentMethod'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: autopayAgreement
      type: object
      x-tags:
        - System Documents & UI
    AvailableTemplateContextSubjectDrawFundsDisclosure:
      description: >
        ### Displayed When

        Dislosure/consent shown to a borrower when they request to draw
        additional funds on line of credit.
          
        The context variables included by system when it displays
        `drawFundsDisclosure`
      properties:
        company:
          $ref: '#/components/schemas/Company'
        drawAmount:
          description: |
            The amount of additional funds drawn.
          type: number
        institutionName:
          description: |
            The name of the institution from which the funds are drawn.
          type: string
        paymentMethod:
          $ref: '#/components/schemas/ContextVarPaymentMethod'
        paymentMethodLastFour:
          $ref: '#/components/schemas/ContextVarPaymentMethodLastFour'
        person:
          $ref: '#/components/schemas/ContextVarPerson'
      title: drawFundsDisclosure
      type: object
      x-tags:
        - System Documents & UI
    ContextObject:
      anyOf:
        - description: >
            The data used to render the template. Provided in JSON format, it
            must be a mapping 

            of context variables to values. 


            The context variables of `borrower`, `loan`, `case` and `statement` 

            do not need to be provided since the system will automatically add
            these objects

            to context assuming you provide `personId`, `loanId`, `caseId` and
            `statementId` to 

            the endpoint.


            For example if your provided the context...


            ```

            {
              "dateSigned": "Aug 27, 2021"
              "lenderName": "Peachy Lender"
              "paymentMethod": "bankAccount"
              "paymentMethodLastFour": "1110"
              "supportEmail": "support@peach.com"
              "supportPhone": "888-888-8888"
            }

            ```


            ...then a template like `Hello from {{lenderName}}!` would render
            like `Hello from Peachy Lender!`
          type: object
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectAutopayAmountChanged
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectAutopayCanceledBySystem
        - $ref: '#/components/schemas/AvailableTemplateContextSubjectAutopayEnabled'
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectAutopayEnableReminder
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectAutopayPaymentCanceled
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectAutopayPaymentMethodUpdated
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectAutopayPaymentReminder
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectAutopayPaymentRescheduled
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectCardExpiresReminder
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectCeaseCommunicationAcknowledgement
        - $ref: '#/components/schemas/AvailableTemplateContextSubjectCeaseRefuseToPay'
        - $ref: '#/components/schemas/AvailableTemplateContextSubjectConfirmationCode'
        - $ref: '#/components/schemas/AvailableTemplateContextSubjectContactTakeover'
        - $ref: '#/components/schemas/AvailableTemplateContextSubjectCustomX'
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectDebtValidationNotice
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectDebtValidationNoticeArizona
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectDebtValidationNoticeAutomatic
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectDebtValidationNoticeNYCYonkers
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectDebtValidationNoticePuertoRico
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectDeceasedConfirmationOfPayoff
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectDeceasedNoticeToRepresentative
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectDeceasedNotificationUponDeath
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectDisputeOfDebtSubmitDocumentation
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectDisputeOfDebtConfirmed
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectDisputeOfDebtSubmitDocumentationReminder
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectDisputeOfDebtUnableToConfirm
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectDisputeOfDebtUnableToResolve
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectElectronicConsentOptOut
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectFailedSettlementInvestor
        - $ref: '#/components/schemas/AvailableTemplateContextSubjectFreeFormBranded'
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectFuturepayCanceled
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectFuturepayPaymentDueReminder
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectIdentityTheftIncompleteDocumentation
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectIdentityTheftSubmitDocumentationFirstReminder
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectIdentityTheftSubmitDocumentation
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectIdentityTheftSubmitDocumentationSecondReminder
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectIdentityTheftValidated
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectIdentityTheftNotValidated
        - $ref: '#/components/schemas/AvailableTemplateContextSubjectAutopayAgreement'
        - $ref: >-
            #/components/schemas/AvailableTemplateContextSubjectDrawFundsDisclosure
      x-peach-hacks: remove-available-template-context-subjects
    TemplateRender:
      properties:
        caseId:
          description: >
            The unique identifier of the Case. Can be Peach or lender's external
            identifier. The case attributes will be used as dynamic fields in
            the template.
          type: string
        channel:
          description: >
            Templates with the same subject can have multiple versions per
            channel. For example: `paymentFailed` can have `email` and `text`
            message (aka SMS) versions.
          enum:
            - email
            - text
            - mail
            - gui
            - document
          type: string
        context:
          $ref: '#/components/schemas/ContextObject'
        loanId:
          description: >
            The unique identifier of the Loan. Can be Peach or lender's external
            identifier. The loan attributes will be used as dynamic fields in
            the template.
          type: string
        overrideTemplateId:
          $ref: '#/components/schemas/OverrideTemplateId'
        personId:
          description: >
            The unique identifier of the Borrower. Can be Peach or a lender's
            external identifier. The borrower attributes will be used as dynamic
            fields in the template.
          type: string
        subject:
          $ref: '#/components/schemas/InteractionSubject'
      type: object
    SendMessageChannel:
      description: >
        The channels the Send Message endpoint can deliver to. This is a subset
        of

        the full `InteractionChannel` enum: `fax`, `chat`, `gui`, and `document`
        are

        not valid send channels and requests using them are rejected with a
        `400`.
      enum:
        - voice
        - email
        - text
        - mail
      type: string
    SendIsTransactional:
      description: >
        If `true`, then sent this interaction as "transactional". 


        Transactional interactions are those which are sent via an automated
        system in response 

        to an event or some action taken. e.g., an email sent to confirm a
        payment was made is transactional;

        likewise an email sent to confirm a password change is transacrtional.
        Examples of

        non-transactional messages would be: those sent by an agent in response
        to a customer request,

        for collections, or for marketing.


        It's important to mark these messages correctly, because different laws
        may apply to messages

        depending on if they're considered "transactional".


        Additionally, a transactional interaction may be sent with different
        "From:" and "Reply-To:" fields depending on configuration.

        The purpose here being that it may be desirable to send messages from an
        email address

        that is clearly marked as "unmonitored", so that recipients do not try
        to respond

        directly to those email addresses.
      type: boolean
    SendIsTransactionalDefaultTrue:
      allOf:
        - $ref: '#/components/schemas/SendIsTransactional'
        - default: true
          type: boolean
    schemas-AssociatedLoanId:
      description: >
        The ID of a Loan. This marks a particular loan as associated with this
        interaction.


        Hydrates to the `loan` context variable for use in the template
      example: LN-AAAA-BBBB
      type: string
    schemas-AssociatedLoanIds:
      description: >
        The IDs of several loans. This marks several loans as associated with
        this interaction.


        Hydrates to the `loans` context variable for use in the template
      example:
        - LN-AAAA-BBBB
        - LB-CCCC-DDDD
      items:
        type: string
      type: array
    CommunicatorSend:
      properties:
        attachments:
          description: |
            List of document IDs for documents to attach to the outgoing email.
          items:
            description: A document descriptor ID.
            type: string
          type: array
        caseId:
          description: |
            Mark a particular case as associated with this message.

            Hydates to the `case` context variable for use in the template
            being rendered for send.
          example: CS-AAAA-BBBB
          type: string
        channel:
          description: >
            Specifies the channel(s) to send the message on.


            If an array is provided then the message will be sent to the most
            appropriate contact

            for each specified channel. As long as at least one contact is
            found, the message

            will be sent, if at least one contact could be found then an error
            will be returned.
          oneOf:
            - $ref: '#/components/schemas/SendMessageChannel'
            - items:
                $ref: '#/components/schemas/SendMessageChannel'
              type: array
        contactId:
          description: |
            The Contact ID of the borrower to which this message should be sent.

            If not provided then the system will try to select an appropriate
            contact based on the type of message being sent. (e.g., if this
            is an email select the primary email address; if this is a
            text message select the borrower's mobile phone.)
          example: BO-AAAA-BBBB
          type: string
        context:
          $ref: '#/components/schemas/ContextObject'
        interactionExternalId:
          description: |
            The external ID of the interaction that will be created as a
            result of this request. Subsequent attempts to send with the
            same external ID will be blocked.
          maxLength: 50
          type: string
        isTransactional:
          $ref: '#/components/schemas/SendIsTransactionalDefaultTrue'
        loanId:
          $ref: '#/components/schemas/schemas-AssociatedLoanId'
        loanIds:
          $ref: '#/components/schemas/schemas-AssociatedLoanIds'
        overrideRecipient:
          description: >
            The recipient to which this message should be sent. This should be
            used in special

            cases where you cannot create a `Contact` and use `contactId`.


            WARNING: It is not recommended to use this field. Instead use
            `contactId` to specify the contact.


            You can only use this field if:

            - The interaction channel is `email`

            - A `borrowerId` is specified

            - A `previousInteractionId` is specified, to an email interaction
            belonging to that borrower

            - That previous interaction was sent "from:" the same email address
            as the one you want to send to.

            Currently only email addresses are supported for this field.
          minLength: 1
          nullable: true
          type: string
        overrideTemplateId:
          $ref: '#/components/schemas/OverrideTemplateId'
        personId:
          description: >
            The Borrower ID of the borrower to which this message should be
            sent.


            Hydates to the `person` context variable for use in the template

            being rendered for send.
          example: BO-AAAA-BBBB
          type: string
        previousInteractionId:
          type: string
        sendAt:
          description: >
            This attribute determines when the message should be sent.

            If set to `null`, and the message's timing conflicts with

            Compliance Guard's time-of-day restrictions, Communicator

            will automatically reschedule it to an allowable time.

            If this auto-rescheduling occurs, the sendAt field in the

            Interaction response will show the new scheduled time, and

            the Interaction status will be marked as `scheduled`.


            To bypass auto-rescheduling, input the current time for

            `sendAt` when calling the endpoint.


            **Additional Information:**

            - Regardless of when the message is scheduled to send, its

            content will be generated immediately upon calling this endpoint.

            - You can manually set a future send time of up to 7 days in the
            future.
          format: date-time
          type: string
        sendJitter:
          description: >
            The maximum number of seconds to add to the send time for this
            communication.

            The actual time added will be between 0 and this value.

            This is useful for spreading out the delivery

            of a large batch of messages over a period of time in order

            to avoid delaying other time-sensitive communcations.
          format: int32
          type: integer
        statementId:
          description: Mark a particular statement as associated with this message.
          example: SM-AAAA-BBBB
          type: string
        strictUndefined:
          default: false
          description: |
            If `true` an error will be returned if the template contains
            a variable that is not defined in the context. For historical
            reasons this is `false` by default, but it is recommended
            to set this to `true`.
          type: boolean
        subject:
          $ref: '#/components/schemas/InteractionSubject'
        supercaseBulkOperationId:
          type: string
        theme:
          $ref: '#/components/schemas/InteractionTheme'
        useTemplate:
          default: true
          description: >
            Only applicable when `channel=mail`. If `false`, will not generate
            content from a template and will instead

            only use the documents referenced in the `attachments` field.
          type: boolean
      required:
        - subject
        - personId
      type: object
    SendIsTransactionalDefaultFalse:
      allOf:
        - $ref: '#/components/schemas/SendIsTransactional'
        - default: false
          type: boolean
    language:
      default: en
      description: The ISO 639-1 two character code of the email language.
      example: en
      maxLength: 2
      minLength: 2
      type: string
    SubjectDescriptor:
      properties:
        agentCanSend:
          description: If set to `true`, agent can send message with this subject from CRM.
          type: boolean
        caseTypes:
          items:
            $ref: '#/components/schemas/BaseCaseType'
          type: array
        previewOnly:
          description: >
            If `true`, the output of templates with this subject must be edited
            before sending.
          type: boolean
        subject:
          allOf:
            - readOnly: true
            - $ref: '#/components/schemas/InteractionSubject'
        theme:
          $ref: '#/components/schemas/InteractionTheme'
        title:
          description: |
            ** DEPRECATED ATTRIBUTE **

            The title to use when showing in the UI.
          readOnly: true
          type: string
      type: object
    CompanyId:
      example: CP-AAAA-BBBB
      pattern: CP-[A-Z0-9]{4}-[A-Z0-9]{4}
      type: string
    TemplateVersionId:
      example: TV-AAAA-BBBB
      pattern: TV-[A-Z0-9]{4}-[A-Z0-9]{4}
      type: string
    ActiveTemplateVersionId:
      allOf:
        - $ref: '#/components/schemas/TemplateVersionId'
        - description: >
            The ID of the active version of the template. This is the version
            that will be used when rendering the template.
          nullable: true
          type: string
    TemplateDescriptorId:
      description: ID of the Template Descriptor
      example: TD-AAAA-BBBB
      pattern: TD-[A-Z0-9]{4}-[A-Z0-9]{4}
      type: string
    LoanTypeIdNullable:
      description: >
        The Loan Type ID to which this template is associated. By configuring

        a Loan Type for a Template Descriptor it is possible to use completely
        different 

        templates for different types of loans.
      example: LT-AAAA-BBBB
      nullable: true
      pattern: LT-[A-Z0-9]{4}-[A-Z0-9]{4}
      type: string
    TemplateSubject:
      anyOf:
        - $ref: '#/components/schemas/InteractionSubject'
        - enum:
            - base1
            - base2
            - base3
          type: string
      description: The subject of the template
      type: string
    TemplateDescriptorMutate:
      additionalProperties: false
      properties:
        channel:
          $ref: '#/components/schemas/InteractionChannel'
        enabled:
          default: true
          description: >
            If `true`, then this template is disabled. Attempts to send messages
            with this

            template will be rejected. (Return `400` responses from the API.)
          type: boolean
        language:
          $ref: '#/components/schemas/language'
        name:
          description: >
            An optional human-friendly name for templates. Only the
            `Custom1`-`Custom100`

            family of subjects can have a custom name.
          maximum: 100
          minimum: 1
          type: string
        productId:
          $ref: '#/components/schemas/LoanTypeIdNullable'
        sensitive:
          default: false
          description: >
            If `true`, then all interactions and documents created from this
            template will have 

            the `sensitive` field set to `true`. Such interaction and documents
            cannot have their 

            content viewed except with a special permission
            (`interaction:read.sensitive`). 


            Usually this would be used to prevent employees without need to
            access 

            private information from accessing it.
          type: boolean
        subject:
          $ref: '#/components/schemas/TemplateSubject'
      type: object
    TemplateDescriptor:
      allOf:
        - properties:
            activeVersionId:
              $ref: '#/components/schemas/ActiveTemplateVersionId'
              description: >
                The ID of the active version of the template. This is the
                version that will be used when rendering the template.
              example: TV-AAAA-BBBB
            companyId:
              $ref: '#/components/schemas/CompanyId'
            id:
              $ref: '#/components/schemas/TemplateDescriptorId'
          type: object
        - $ref: '#/components/schemas/TemplateDescriptorMutate'
    ContentHtmlTemplate:
      description: >
        A valid Jinja template to use for the content HTML body. This is used,
        for instance,

        for the body of an HTML email.


        This is simply ignored when the channel does not need HTML content.


        The context variables available to this template are the same as the
        context available to 

        `contentTextTemplate`
      example: Hello,<br/><p>{{foobar}}</p>
      nullable: true
      type: string
    ContentTextTemplate:
      description: >
        A valid Jinja template to use for the content text body. This is used,
        for instance,

        for the body of a plain text email or text message.
      example: Hello {{foobar}}
      nullable: true
      type: string
    TemplateVersionStatus:
      deprecated: true
      description: >
        **Deprecated.** This field is non-operational and will be removed in a
        future API version.


        On write requests, any value (`draft`, `deployed`, `deprecated`, or
        `null`) is accepted

        but silently ignored — the value is not stored.


        On read responses, this field always returns `null`.
      enum:
        - draft
        - deployed
        - deprecated
        - null
      nullable: true
      type: string
    SubjectLineTemplate:
      description: >
        A valid Jinja template to use for the subject line. This is used, for
        instance,

        for the subject line when sending emails.


        This is simply ignored when the channel does not need a subject.


        The context variables available to this template are the same as the
        context available to 

        `contentTextTemplate`
      example: Hello {{foobar}}
      nullable: true
      type: string
    TemplateVersionMutate:
      additionalProperties: false
      properties:
        activate:
          default: false
          description: >
            Only applies when creating a template version. If `true`, the newly
            created

            version is immediately set as the active version of its template
            descriptor,

            equivalent to calling the activate endpoint in a separate request.


            Setting this to `true` requires the `communicator.template:activate`
            permission

            in addition to `communicator.template:create`. This field is ignored
            on update.
          type: boolean
        contentHtmlTemplate:
          $ref: '#/components/schemas/ContentHtmlTemplate'
        contentTextTemplate:
          $ref: '#/components/schemas/ContentTextTemplate'
        descriptorId:
          $ref: '#/components/schemas/TemplateDescriptorId'
        status:
          $ref: '#/components/schemas/TemplateVersionStatus'
        subjectLineTemplate:
          $ref: '#/components/schemas/SubjectLineTemplate'
    TemplateVersion:
      allOf:
        - properties:
            id:
              $ref: '#/components/schemas/TemplateVersionId'
          type: object
        - $ref: '#/components/schemas/TemplateVersionMutate'
    OneTimeCodeChannel:
      description: |
        The channel via which to send the one time code through.
      enum:
        - email
        - text
        - voice
      type: string
    CollectionAgencyCreate:
      allOf:
        - $ref: '#/components/schemas/BaseWithExternalIdMixin'
        - properties:
            companyId:
              description: |
                The unique company identifier.
              readOnly: true
              type: string
            contactEmail:
              description: >
                The third party debt collection agency email address that the
                charged-off loan was assigned to.
              type: string
            contactPhone:
              description: >
                The third party debt collection agency primary phone that the
                charged-off loan was assigned to. Should be provided in E.164
                format.
              type: string
            legalName:
              description: >
                The third party debt collection agency name that the charged-off
                loan was assigned to.
              type: string
            mailingAddress:
              $ref: '#/components/schemas/AddressBase'
              description: >
                The third party debt collection agency mailing address that the
                charged-off loan was assigned to.
          type: object
    CollectionAgency:
      allOf:
        - $ref: '#/components/schemas/CollectionAgencyCreate'
        - properties:
            isArchived:
              description: >
                Set to true if the debt collection agency no longer active.
                Loans that were assigned to that agency will keep the reference,
                but new loans cannot be assigned.
              type: boolean
          type: object
    CollectionAgencyPost:
      allOf:
        - $ref: '#/components/schemas/CollectionAgencyCreate'
        - properties:
            mailingAddress:
              allOf:
                - $ref: '#/components/schemas/AddressBase'
                - required:
                    - addressLine1
                    - city
                    - state
                    - postalCode
                    - country
                  type: object
          type: object
    AgencyName:
      description: |
        The credit agency name.
      enum:
        - experian
        - equifax
        - transUnion
        - innovis
      type: string
    CreditAgency:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            agencyName:
              $ref: '#/components/schemas/AgencyName'
            companyId:
              description: |
                The unique company identifier.
              readOnly: true
              type: string
            country:
              description: The credit agency country.
              maxLength: 2
              type: string
            dataFormat:
              description: The format of the reported data and file.
              enum:
                - metro2
              type: string
            encryptionMethod:
              description: >
                The encryption method that Peach system with use to encrypt the
                files.
              enum:
                - GPG
              nullable: true
              type: string
            fileNamePrefix:
              description: >
                The file name prefix. Must be provided if `agencyName=experian`
                and `nameFilePerAgencyConvention=true`. Only used if
                `agencyName=experian` and `nameFilePerAgencyConvention=true`.
              type: string
            isPeachAggregator:
              default: false
              description: >
                **DEPRECATED ATTRIBUTE**


                This field is deprecated, and is only included to remain
                backward compatible. Only send `false`.
              type: boolean
            nameFilePerAgencyConvention:
              default: true
              description: >
                If `true` Peach system will name the file based on the credit
                agency convention.


                **Equifax**: Company legal name + Company ID + Credit agency
                name + today's date YYYYMMDD + .txt.

                For example: `PEACHFINANCEINCCPYL69X5Z1EQUIFAX20211021.txt`.


                **Experian**: `fileNamePrefix` + `.` + today's date MMDDYYYY +
                .txt.

                For example: MKFRT.10262021.txt.


                **TransUnion**: Company legal name + Company ID + Credit agency
                name + today's date YYYYMMDD + .txt.

                For example: `PEACHFINANCEINCCPYL69X5Z1TRANSUNION20211213.txt`.


                If `false` Peach system will name the file as:

                Company legal name + Company ID + Credit agency name + today's
                date YYYYMMDD + .txt

                For example: `PEACHFINANCEINCCPYL69X5Z1EXPERIAN20211021.txt`
              type: boolean
            publicKey:
              description: >-
                The lender's public key to use to encrypt the files. A value
                must be passed if encryptionMethod is set.
              nullable: true
              type: string
            sftpAccessMethod:
              default: usernamePassword
              description: >
                If `usernamePassword`, then `sftpUsername` and `sftpPassword`
                must be provided.


                If `keys`, then `sftpSSHPeachPrivateKey` and
                `sftpSSHPeachPublicKey` will be created by peach.
              enum:
                - usernamePassword
                - keys
              type: string
            sftpCdDir:
              description: |
                Change directory into this folder before performing the upload.
              type: string
            sftpHostname:
              description: >
                The SFTP hostname. If SFTP hostname, username, and password are
                set, they will be used instead of the default credit bureau
                credentials.

                Host name should not contain a scheme, so don't put `sftp://` on
                the front. You may optionally specify a port like so:
                `example.com:222`.

                If no port is supplied a default of 22 will be used.
              nullable: true
              pattern: ^[^/]+$
              type: string
            sftpPassword:
              description: |
                The password for SFTP.
              nullable: true
              type: string
            sftpSSHPeachPrivateKey:
              description: >
                An opaque reference to Peach's SSH private key, used internally
                to authenticate with `sftpHostname`. Only populated when
                `sftpAccessMethod` is `keys`.
              nullable: true
              readOnly: true
              type: string
            sftpSSHPeachPublicKey:
              description: >
                Peach's SSH public key to be whitelisted on `sftpHostname`. Only
                populated when `sftpAccessMethod` is `keys`.
              nullable: true
              readOnly: true
              type: string
            sftpUsername:
              description: |
                The username for SFTP.
              nullable: true
              type: string
            specificDays:
              description: >
                Specific days designate the day(s) when to upload the credit
                reporting file. Only the 1st day of the month is currently
                supported.


                The allowed values for specific day(s) depends on the
                uploadFrequency.

                `monthly` - provide one number in the valid range 1-31. 1=first
                day of a month. Use 31 to indicate the last day of a month.


                For example: [1].
              items:
                maximum: 31
                minimum: 1
                type: integer
              type: array
            uploadFrequency:
              description: >-
                The credit reporting file creation frequency. Only monthly is
                currently supported.
              enum:
                - monthly
              type: string
            useLoanExternalId:
              default: true
              description: >
                Indicates what identifier to use as an account identifier for
                credit reporting.


                If `true`, the system will use loan `externalId` as an account
                identifier for credit reporting. If `externalId` doesn't exist
                the system will use loan Peach Public ID.


                If `false`, the system will use loan Peach Public ID (e.g.
                LN-JFU3-ER3S) as an account identifier for credit reporting.
              type: boolean
          type: object
    Error:
      properties:
        message:
          nullable: true
          readOnly: true
          type: string
        status:
          format: int32
          readOnly: true
          type: integer
      required:
        - status
      type: object
    CallSummaryResultStatus:
      description: The status of the call summary result.
      enum:
        - pending
        - completed
        - failed
      type: string
    CallSummaryResult:
      allOf:
        - $ref: '#/components/schemas/BaseWithExternalIdMixin'
        - properties:
            companyId:
              description: The unique company identifier.
              type: string
            object:
              default: AICallSummaryResult
              enum:
                - AICallSummaryResult
              type: string
            status:
              $ref: '#/components/schemas/CallSummaryResultStatus'
            summary:
              description: The summary of the call.
              nullable: true
              type: string
            transcriptionResultId:
              description: The unique identifier for the call transcription result.
              type: string
          type: object
      description: Represents the result of a call summary.
    CallSummaryResultsPaging:
      allOf:
        - $ref: '#/components/schemas/NewPaginator'
        - properties:
            data:
              items:
                $ref: '#/components/schemas/CallSummaryResult'
              type: array
          type: object
    InteractionsManyNoPaging:
      properties:
        data:
          items:
            $ref: '#/components/schemas/Interaction'
          type: array
        message:
          type: string
        status:
          description: HTTP status code.
          type: integer
      type: object
    InvestorImmutableFields:
      properties:
        currency:
          description: >
            The currency that the investor will receive settlements in. Use ISO
            currency codes.


            Set to `USD` for all investors, other currencies are not supported
            yet.
          readOnly: true
          type: string
        externalId:
          description: A lender's identifier for the investor.
          type: string
        id:
          description: The investor ID
          readOnly: true
          type: string
        legalName:
          description: The legal name of the investor.
          type: string
      type: object
    ValidAddress:
      description: Identifies the address as valid or invalid.
      readOnly: true
      type: boolean
    InvestorMutableFields:
      properties:
        address:
          $ref: '#/components/schemas/Address'
        contactEmail:
          description: The email of the investor's primary contact person.
          format: email
          type: string
        contactName:
          description: The name of the investor's primary contact person.
          type: string
        contactPhone:
          description: The phone number of the investor's primary contact person.
          maxLength: 15
          type: string
        default:
          default: false
          description: >
            Mark this investor as the default investor.


            At loan creation, if no investors are specified in the
            `atOrigination.investors` attribute, the investor with
            `default=true` is

            added with `shares=1` (100%).


            If a new investor is created and there is another investor with
            `default=true`, the system will set `default=false` for the other
            investor.
          type: boolean
        validAddress:
          $ref: '#/components/schemas/ValidAddress'
      type: object
    Investor:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - $ref: '#/components/schemas/InvestorImmutableFields'
        - $ref: '#/components/schemas/InvestorMutableFields'
      required:
        - legalName
      title: Investor
    InvestorMutable:
      allOf:
        - $ref: '#/components/schemas/InvestorMutableFields'
      title: Investor
    PaymentInstrumentImmutableFields:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            activeAt:
              description: The date and time at which the instrument was set to `active`.
              format: date-time
              readOnly: true
              type: string
            id:
              description: Unique identifier of the instrument.
              readOnly: true
              type: string
            inactiveAt:
              description: The date and time at which the instrument was set to `inactive`.
              format: date-time
              readOnly: true
              type: string
            isExternal:
              description: >-
                A payment instrument marked `isExternal=true` is not verified
                and creates transactions for record purposes only. The
                `payment.instrument:external` permission is required to set this
                flag.
              type: boolean
            pendingAt:
              description: The date and time at which the instrument was set to `pending`.
              format: date-time
              nullable: true
              type: string
          type: object
    TransactionFailureReason:
      description: The transaction failure reason.
      enum:
        - insufficientFunds
        - chargeback
        - accountClosed
        - invalidAccount
        - unknownReason
        - invalidCvv
        - invalidExpirationDate
        - avsFailed
        - networkError
        - cardDeclined
        - accountFrozen
        - deceased
        - invalidRouting
        - paymentStopped
        - microdepositsFailed
        - microdepositsAttemptFailed
        - incorrectNumber
        - fraudulent
        - unauthorizedDebit
      type: string
    PaymentInstrumentFailureReasons:
      properties:
        failureDescriptionLong:
          description: >
            Detailed text describing the failure reason and any appropriate
            actions the borrower may take to fix the issue.

            Normally displayed in UI.
          readOnly: true
          type: string
        failureDescriptionShort:
          description: |
            Short text describing the failure reason. Normally displayed in UI.
          readOnly: true
          type: string
        failureReason:
          $ref: '#/components/schemas/TransactionFailureReason'
          description: >
            A failure code for the most recent transaction failure using this
            instrument.
          nullable: true
      type: object
    PaymentInstrumentMutableFields:
      properties:
        externalId:
          description: >
            A lender's identifier for the instrument.


            After the object is successfully created, a lender can use ID or
            externalId identifiers to fetch the object.


            To fetch the object using externalId you need to add `ext-` to the
            URL.


            Note: Don't add ext- to the identifier value. For example: if the
            external identifier is `ABCDE`, then pass externalId=ACBCE and NOT
            ext-ABCDE when creating the object.
          minLength: 1
          nullable: true
          type: string
        inactiveReason:
          description: >
            The reason the instrument is inactive. Required when setting
            status=`inactive`.
          enum:
            - fraudAlert
            - updated
            - notVerified
            - expired
            - failed
            - deleted
          type: string
        nickname:
          description: A nickname for the instrument. The nickname can be displayed in UI.
          type: string
        status:
          default: pending
          description: >
            Status of the instrument. Can only be set if `isExternal=true`.


            Statuses:


            - `active` - the instrument can be charged.

            - `pending` - the instrument is pending to be verified.

            - `inactive` - the instrument is not active and cannot be charged.


            When updating this field, only the following state transitions are
            allowed.


            ```

            active --> inactive

            pending --> active (only for payment instrument with
            isExternal=true)

            pending --> inactive (only for payment instrument with
            isExternal=true)

            inactive --> active (only for payment instrument with
            isExternal=true)

            inactive --> pending (only for payment instrument with
            isExternal=true)

            ```


            Note: if you update the status from `inactive` to `active` or
            `pending`,

            the system will clear the following attributes: `inactiveReason`,
            `deletedAt`, `failureReason`,

            `failureDescriptionShort`, `failureDescriptionLong`.
          enum:
            - active
            - inactive
            - pending
          type: string
        verified:
          default: false
          description: >
            Indicates whether the instrument has been verified.


            User must have the `payment.instrument:skip.verification` permission
            to set this value to `true`, or

            the payment instrument must be marked `isExternal=true`.
          type: boolean
      type: object
    BankAccountImmutableFields:
      properties:
        accountNumberLastFour:
          description: >
            The last two, three or four digits of the account number.

            Normally, you should expect four digits. Two or three digits are
            returned when four digits are not available.
          pattern: ^[0-9]{2,4}$
          readOnly: true
          type: string
        instrumentType:
          enum:
            - bankAccount
          type: string
        routingNumber:
          description: The routing number.
          type: string
      type: object
    AccountLinkError:
      properties:
        errorCodeByVendor:
          description: The error code as received from the vendor.
          type: string
        errorDescriptionBorrower:
          description: >-
            The error description as received from the vendor for presentation
            to the borrower.
          type: string
        errorDescriptionInternal:
          description: The internal error description as received from the vendor.
          type: string
        errorType:
          description: >-
            The error type. This describes the appropriate way to handle the
            error.
          enum:
            - retry
            - relink
            - outage
          type: string
        errorTypeByVendor:
          description: The error type as received from the vendor.
          type: string
      type: object
    AccountLink:
      description: >-
        An object representing a link with a third party vendor (e.g. Plaid)
        that allows fetching additional account details.
      properties:
        accessToken:
          description: >-
            The vendor's access token for initial access. With Plaid, this can
            be the `public_token` provided by Plaid Link, or the `access_token`
            provided after exchanging the public token.
          type: string
        accountId:
          description: The identifier used to identify an account with the data vendor.
          type: string
        dataServices:
          default:
            - accountInfo
          description: A list of data services available with this link.
          items:
            enum:
              - accountInfo
              - balance
            type: string
          type: array
        errorCommunicationsSent:
          description: >-
            The number of times the user has been notified that the account link
            has failed and needs to be recreated.
          readOnly: true
          type: integer
        itemId:
          description: The vendor's item identifier. With Plaid, this is the `item_id`.
          type: string
        lastErrorCommunicationAt:
          description: >-
            The date and time that the most recent error notification was sent
            to the user.
          format: date-time
          readOnly: true
          type: string
        recentError:
          allOf:
            - description: >-
                The most recent error that occurred while fetching data from
                this link.
            - $ref: '#/components/schemas/AccountLinkError'
        status:
          description: The status of the account link.
          enum:
            - active
            - inactive
          type: string
        vendor:
          description: The data vendor identifier.
          enum:
            - plaid
          type: string
      required:
        - vendor
        - accessToken
        - accountId
      type: object
    BankAccountMutableFields:
      properties:
        accountHolderName:
          description: >
            For `personal` accounts, the full name of the account holder. For
            `business` accounts, the business name.


            <strong style="color: red">This is not an account nickname. It
            should match the name on file for the account with the
            bank.</strong>
          type: string
        accountHolderType:
          description: Type of entity that is the account holder.
          enum:
            - business
            - personal
          type: string
        accountLink:
          $ref: '#/components/schemas/AccountLink'
        accountType:
          description: Type of the account.
          enum:
            - checking
            - savings
          type: string
        institutionName:
          description: >
            The name of the financial institution where this account resides. If
            empty, will default to the name associated

            with the routing number.
          maxLength: 36
          type: string
      type: object
    BankAccount:
      allOf:
        - $ref: '#/components/schemas/PaymentInstrumentImmutableFields'
        - $ref: '#/components/schemas/PaymentInstrumentFailureReasons'
        - $ref: '#/components/schemas/PaymentInstrumentMutableFields'
        - $ref: '#/components/schemas/BankAccountImmutableFields'
        - $ref: '#/components/schemas/BankAccountMutableFields'
      required:
        - accountHolderName
        - accountHolderType
        - accountNumber
        - accountType
        - instrumentType
        - routingNumber
      title: Bank Account
    bankAccountAccountNumber:
      properties:
        accountNumber:
          description: >
            The account number.

            If `isExternal=true` then the last two, three, or four digits of the
            account number can be provided.

            Provide four digits if available, otherwise provide two or three
            digits.
          pattern: ^[0-9]+$
          type: string
          writeOnly: true
      required:
        - accountNumber
      type: object
    SettlementInstrument:
      allOf:
        - $ref: '#/components/schemas/BankAccount'
        - $ref: '#/components/schemas/bankAccountAccountNumber'
        - properties:
            investorId:
              description: Public ID of the investor.
              readOnly: true
              type: string
            verified:
              readOnly: true
          type: object
    BankAccountMutable:
      allOf:
        - $ref: '#/components/schemas/PaymentInstrumentMutableFields'
        - $ref: '#/components/schemas/BankAccountMutableFields'
      title: Bank Account
    SettlementInstrumentMutable:
      allOf:
        - $ref: '#/components/schemas/BankAccountMutable'
        - type: object
    LoanIdsResponse:
      properties:
        loanIds:
          description: >
            The list of loans which have the specified label(s) and match the
            path and query parameters.
          items:
            type: string
          maxItems: 100
          type: array
      type: object
    LoanIdsRequest:
      properties:
        loanIds:
          description: >
            The unique identifier of the loans. Can be Peach or lender's
            external identifier.
          items:
            type: string
          maxItems: 100
          type: array
      type: object
    LoanTapeFields:
      items:
        enum:
          - reportDate
          - investorId
          - investorLegalName
          - investorOwnershipPercentage
          - secondInvestorId
          - secondInvestorLegalName
          - secondInvestorOwnershipPercentage
          - loanId
          - loanStatus
          - loanExternalId
          - loanType
          - loanTypeId
          - mainBorrowerId
          - mainBorrowerExternalId
          - currentCreditLimit
          - activationDate
          - lastDueDate
          - effectiveAPR
          - interestRate
          - indexRate
          - promoRate
          - interestType
          - contractualRecurringAmount
          - amountFinanced
          - firstDueDateExpectedAmount
          - firstDueDatePaymentAmountByDueDate
          - upcomingDueDate
          - upcomingDueDateExpectedAmount
          - outstandingBalanceTotalAmount
          - outstandingBalancePrincipalAmount
          - outstandingBalanceInterestAmount
          - outstandingBalanceFeesAmount
          - creditsAppliedTotalAmount
          - paymentsMadeTotalAmount
          - paymentsMadePrincipalAmount
          - paymentsMadeInterestAmount
          - paymentsMadeFeesAmount
          - paymentsMadeOverAmount
          - paymentsMadeReimbursementsAmount
          - lastSuccessfulPaymentEffectiveDate
          - lastSuccessfulPaymentTotalAmount
          - lastSuccessfulPaymentPrincipalAmount
          - lastSuccessfulPaymentInterestAmount
          - lastSuccessfulPaymentFeesAmount
          - isAutopayOn
          - recentAutopayAuthorizationDate
          - isOverdue
          - overdueNumberDays
          - overdueBalanceTotalAmount
          - overdueBalancePrincipalAmount
          - overdueBalanceInterestAmount
          - overdueBalanceFeesAmount
          - nonDueBalanceTotalAmount
          - nonDueBalancePrincipalAmount
          - nonDueBalanceInterestAmount
          - nonDueBalanceFeesAmount
          - dailyInterestAccruedAmount
          - dailyInterestDiscountAmount
          - dailyForgoneInterestCapAmount
          - dueBalanceTotalAmount
          - dueBalancePrincipalAmount
          - dueBalanceInterestAmount
          - dueBalanceFeesAmount
          - timesOverdue15Days
          - timesOverdue30Days
          - timesOverdue60Days
          - timesOverdue90Days
          - timesOverdue120Days
          - isChargedOff
          - chargedOffDate
          - chargedOffPrincipalAmount
          - chargedOffInterestAmount
          - chargedOffFeesAmount
          - chargedOffTotalAmount
          - chargedOffReason
          - netInterestAccruedTotalAmount
          - interestDiscountTotalAmount
          - forgoneInterestCapAmount
          - reimbursementAmount
          - mainBorrowerFirstName
          - mainBorrowerLastName
          - mainBorrowerDateOfBirth
          - mainBorrowerIdentityType
          - mainBorrowerIdentityValue
          - mainBorrowerIdentityIssuingCountry
          - mainBorrowerIdentityIssueDate
          - mainBorrowerIdentityExpirationDate
          - mainBorrowerBusinessLegalName
          - mainBorrowerBusinessType
          - isInSCRAStatus
          - activeDutyStartDate
          - activeDutyEndDate
          - isInBankruptcy
          - bankruptcyFiledDate
          - bankruptcyCourtCaseNumber
          - bankruptcyLastStatus
          - bankruptcyDisposition
          - bankruptcyChapter
          - currentAddressState
          - currentAddressPostalCode
          - currentAddressLine1
          - currentAddressLine2
          - currentAddressCity
          - currentAddressCountry
          - currentEmail
          - currentPhone
          - refundedAmount
          - merchantId
          - merchantBusinessName
          - originalDuration
          - originalPaymentFrequency
          - currentPaymentFrequency
          - currentRecurringAmount
          - paidOffDate
          - loanMetaData
          - isLoanModified
          - principalAmount
          - projectedPayoffDate
          - remainingDuration
          - dataStatus
          - overdueOver30DaysBalanceTotalAmount
          - overdueOver60DaysBalanceTotalAmount
          - overdueOver90DaysBalanceTotalAmount
          - overdueOver120DaysBalanceTotalAmount
          - overdueOver150DaysBalanceTotalAmount
          - overdueOver180DaysBalanceTotalAmount
          - nonDueBalanceOriginationFeesAmount
          - nonDueBalanceDrawFeesAmount
          - nonDueBalanceLateFeesAmount
          - nonDueBalanceModificationFeesAmount
          - dueBalanceOriginationFeesAmount
          - dueBalanceDrawFeesAmount
          - dueBalanceLateFeesAmount
          - dueBalanceModificationFeesAmount
          - originationFeeAmount
          - overdueBalanceOriginationFeesAmount
          - overdueBalanceDrawFeesAmount
          - overdueBalanceLateFeesAmount
          - overdueBalanceModificationFeesAmount
          - outstandingBalanceOriginationFeesAmount
          - outstandingBalanceDrawFeesAmount
          - outstandingBalanceLateFeesAmount
          - outstandingBalanceModificationFeesAmount
          - nonDueBalanceMembershipFeesAmount
          - dueBalanceMembershipFeesAmount
          - overdueBalanceMembershipFeesAmount
          - outstandingBalanceMembershipFeesAmount
        type: string
      title: Loan Tape Fields
      type: array
    PaymentTapeFields:
      items:
        enum:
          - reportDate
          - loanId
          - loanExternalId
          - investorId
          - investorLegalName
          - investorOwnershipPercentage
          - secondInvestorId
          - secondInvestorLegalName
          - secondInvestorOwnershipPercentage
          - transactionId
          - transactionExternalId
          - status
          - effectiveDate
          - totalAmount
          - principalAmount
          - interestAmount
          - feesAmount
          - unappliedAmount
          - paymentMethodType
          - processingFeeType
          - processingFeeAmount
          - isReversal
          - isReimbursement
          - reversingTransactionId
          - reversingTransactionExternalId
          - settlementId
          - settlementDate
        type: string
      title: Payment Tape Fields
      type: array
    BaseLoanTapeType:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            actionOnMissingData:
              default: excludeFromTape
              description: >
                Due to various circumstances, it is possible that not all data
                needed to produce a given loan tape

                will be available at the time of tape generation.


                In this situation, there are two options for how these records
                will be represented in a tape:


                - `includeIDsAndEmptyData` (recommended) - The tape will include
                records that have missing data
                  (only `reportDate`, `loanId`, `mainBorrowerId`, `mainBorrowerExternalId`, `loanExternalId`,
                  and `dataStatus` columns will be populated, assuming they are configured).

                - `excludeFromTape` - Records with missing data will be dropped
                completely from the tape.
                  By choosing `excludeFromTape` lenders will be responsible for validating number of loans included within tapes.
              enum:
                - includeIDsAndEmptyData
                - excludeFromTape
              type: string
            compressionType:
              default: gzip
              description: |
                Compression type used for result file.
              enum:
                - noCompression
                - gzip
                - zip
              type: string
            fieldNameMappings:
              description: >
                Mapping of fields from `fields` to field names used in the
                bank/investor's system.


                For example: `{"investorId": "investor_id", "isChargedOff":
                "loan_charged_off"}`
              type: object
            fields:
              anyOf:
                - $ref: '#/components/schemas/LoanTapeFields'
                - $ref: '#/components/schemas/PaymentTapeFields'
              description: >
                A list of fields to be included in a specific tape. There are
                two `tapeType` available - `loans` and `payments`.

                When you choose a list of fields, make sure to include only the
                values corresponding to `tapeType`.

                For example: `tapeType=loans` cannot have an attribute
                `paymentMethodType` because that field is only relevant to
                `tapeType=payments`.


                `loanMetaData` - is a special field. If included, the caller
                must provide the `loanMetaDataFields` attribute.


                `mainBorrowerIdentityValue` - is the borrower's identity number
                such as SSN, ITIN, tax ID, FEIN, etc.

                This value is encrypted in Peach system. If you want to export
                that value in loan tapes, you must have `encryptionMethod`

                and `publicKey` set when you call "Create loan tape". In other
                words, loan tape must be encrypted in order to

                populate `mainBorrowerIdentityValue`.
            loanMetaDataFields:
              default: []
              description: >
                A list of loan's `metaData` keys/values to be included in a
                specific tape.

                Loan's `metaData` attribute consists of key/value pairs in the
                form of a JSON dictionary.

                The `loanMetaDataFields` value must be provided if
                `loanMetaData` is included in the fields list.

                If the key cannot be found in the loan's `metaData` attribute,
                the tape will populate the column name

                (aka key) but will not populate the value (aka the value will be
                empty).

                If found, each column name will be the "key" + "LoanMetaData"
                and the value will be the "value".

                The search/look up of the `loanMetaDataFields` key in the loan's
                `metaData` attribute is case-sensitive.

                Peach doesn't know what data is provided in the loan's
                `metaData` attribute, and we don't check validity of the
                key/value pairs.

                It's lender/caller responsibility to make sure that the loan's
                `metaData` attribute has valid and formatted values.
              items:
                type: string
              type: array
            moneyUnit:
              default: subUnit100
              description: >
                If `subUnit100`, the amount fields in loan tapes will be in
                pennies. For example: 100 means $1.00 (one dollar).


                If `fullUnit`, the amount fields in loan tapes will be in
                decimal format with 2 places after the decimal point.

                For example: 32.45 is thirty-two dollars and forty-five cents.
              enum:
                - fullUnit
                - subUnit100
              type: string
            reportDaysWhenPaidOff:
              default: 10
              description: >
                Number of days to report a loan after it was changed to
                `paidOff`.

                Make sure you check that your loan types are configured to
                generate snapshots for number of days that is greater than
                reportDaysWhenPaidOff for loans that are in paidOff status.

                If your company has many loan types, please check them all.

                Loans without snapshots data cannot be reported in the loan tape
              minimum: 10
              type: integer
            shouldReportDrawsSeparately:
              default: false
              description: >
                Indicates whether LOC Draws should be reported as separate rows
                in loan tape. LOC will always be reported on an aggregated
                level.
              type: boolean
            tapeName:
              description: |
                A friendly name for the tape.
              type: string
            tapeOutputFormat:
              default: CSV
              description: The tape output format.
              enum:
                - CSV
              type: string
          type: object
    TapeType:
      allOf:
        - $ref: '#/components/schemas/BaseLoanTapeType'
        - properties:
            tapeType:
              description: >
                The loan tape type.


                `loans` - the tape includes information about accounts (e.g.
                loans).


                `payments` - the tape includes information about payments made
                by borrowers.
              enum:
                - loans
                - payments
              type: string
          type: object
    LoanTape:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            activatedAt:
              description: >-
                The UTC timestamp when the tape was first set to `active`. Null
                if still in `draft`, or for tapes created before this field was
                introduced.
              format: date-time
              nullable: true
              readOnly: true
              type: string
            customFileName:
              description: >
                If provided, will override the default file name for new loan
                tape files created.

                [Date and time
                placeholders](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes)
                may be used, along with the following placeholders:


                - `{{loanTapeId}}` the loan tape ID.

                - `{{loanTapeTypeId}}` the loan tape type ID.


                For example, a value of `loan_tape_{{loanTapeId}}_%m_%d_%Y.csv`
                might look like `loan_tape_TA-DJEK-CVDE_02_12_2022.csv` when
                generated.
              nullable: true
              type: string
            dateForCustomFileName:
              default: dateOfGeneration
              description: >
                Controls the date value for the `customFileName` field. Options:


                - `reportDate`: Uses the `reportDate` of the loan tape record

                - `dateOfGeneration`: Uses the date when the loan tape record
                was generated
              enum:
                - reportDate
                - dateOfGeneration
              nullable: true
              type: string
            encryptionMethod:
              description: >
                The encryption method that Peach system with use to encrypt the
                files.
              enum:
                - GPG
              nullable: true
              type: string
            investorId:
              description: The investor ID.
              nullable: true
              type: string
            loanTapeTypeId:
              description: The loan tape type ID.
              type: string
            publicKey:
              description: >-
                The lender's public key to use to encrypt the files. A value
                must be passed if encryptionMethod is set.
              nullable: true
              type: string
            sftpAccessMethod:
              default: usernamePassword
              description: >
                If `usernamePassword`, then `sftpUsername` and `sftpPassword`
                must be provided.


                If `keys`, then `sftpSSHPeachPrivateKey` and
                `sftpSSHPeachPublicKey` will be created by peach.
              enum:
                - usernamePassword
                - keys
              type: string
            sftpCdDir:
              description: |
                Change directory into this folder before performing the upload.
              nullable: true
              type: string
            sftpHostname:
              description: >
                The hostname for SFTP.

                Host name should not contain a scheme, so don't put `sftp://` on
                the front. You may optionally specify a port like so:
                `example.com:222`.

                If no port is supplied a default of 22 will be used.
              pattern: ^[^/]+$
              type: string
            sftpPassword:
              description: The password for SFTP.
              type: string
            sftpSSHPeachPublicKey:
              description: |
                Peach public key to be used when log into `sftpHostname`.
                The value can be only be set by the Peach team.
              readOnly: true
              type: string
            sftpUsername:
              description: The username for SFTP.
              type: string
            status:
              default: active
              description: >
                The status of the loan tape.


                - `draft`: The tape is being configured. Results will not be
                monitored.

                - `active`: The tape is live. `activatedAt` records when it was
                first activated.
              enum:
                - draft
                - active
              type: string
          type: object
    LoanTapeRecord:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            failureDescription:
              description: >-
                Human-readable explanation when `status` is `failed`. Empty
                otherwise.
              type: string
            investorId:
              description: The investor ID.
              nullable: true
              type: string
            loanTapeId:
              description: The loan tape ID.
              type: string
            loanTapeTypeId:
              description: The loan tape type ID.
              type: string
            reportDate:
              format: date
              type: string
            status:
              description: >
                The status of the loan tape generation job.


                - `null`: generation is in progress (the record was created when
                the job was triggered and has not yet reached a terminal state)

                - `succeeded`: the tape was generated (and uploaded, if
                configured) successfully

                - `failed`: generation failed; see `failureDescription` for the
                reason

                - `created`: the tape file was generated but has not yet been
                uploaded to the configured SFTP destination
              enum:
                - succeeded
                - failed
                - created
              nullable: true
              type: string
            tapeFileName:
              type: string
          type: object
    RepaymentNotificationTrigger:
      description: >
        A description of the conditions that trigger a communication. NOTE:
        `autopayExpectedPaymentChangedAmount` will never occur for LOC,

        because autopays are finalized after the statement date and not updated
        again.
      enum:
        - autopayFirstPayment
        - autopayExpectedPayment
        - autopayExpectedPaymentChangedAmount
        - cardExpiration
        - expectedPayment
        - futurePayment
        - loginFirstPayment
        - loanOverdue
        - loanRightToCure
        - promoProgramReminder
        - promoProgramEligibilityAtRisk
      example: expectedPayment
      readOnly: true
      type: string
    RepaymentEngineInteractionSubject:
      description: >-
        The `InteractionSubject` for the notification that is sent to the
        borrower.
      enum:
        - autopayAmountChanged
        - autopayEnableReminder
        - autopayPaymentReminder
        - cardExpiresReminder
        - futurepayPaymentDueReminder
        - loanOverdueFirstNotice
        - loanOverdueSecondNotice
        - loanOverdueThirdNotice
        - loanOverdueFourthNotice
        - loanOverdueFifthNotice
        - loanOverdueSixthNotice
        - loanRightToCurePersonalUnsecured
        - loginFirstPaymentReminder
        - paymentDueDateReminder
        - promoProgramReminder
        - promoProgramEligibilityAtRisk
      example: paymentDueDateReminder
      type: string
    ValidInteractionChannel:
      enum:
        - email
        - text
        - mail
      type: string
    DaysOffsetDueDate:
      oneOf:
        - description: >
            The number of days offset from the due date that a notification is
            sent. Should be negative for reminders and positive for

            overdue notices.


            When `subject=loanRightToCurePersonalUnsecured`, then
            `loanType.rightToCureBuffer` will be used to

            compute the offset.


            When `subject=autopayAmountChanged`, then
            `loanType.autopay.amountChangeNotificationBuffer` will be used

            to compute the offset.


            When `subject=promoProgramReminder` or
            `promoProgramEligibilityAtRisk`, the reminder will trigger
            `daysOffsetDueDate`

            after the `PromoProgram` end date, which is why the value should be
            negative for the reminder and positive for
            `promoProgramEligibilityAtRisk`.
          example: -5
          nullable: true
          type: integer
        - description: >
            This object controls the exact date on which the loanOverdue
            reminder is sent. Note that the offsets are absolute.
          properties:
            everyTwoWeeks:
              description: >
                If the notification type has `trigger=loanOverdue` and
                `isDueDatesAvailableEveryTwoWeeks` is true on this loan type,

                then this offset will be used for loans with payments that are
                due every two weeks.
              type: integer
            monthly:
              description: >
                If the notification type has `trigger=loanOverdue` and
                `isDueDatesAvailableTwiceMonthly` is true on this loan type,

                then this offset will be used for loans with monthly payments.
              type: integer
            singleTerm:
              description: >
                If the notification type has `trigger=loanOverdue` and
                `isDueDatesAvailableSingleTerm` is true on this loan type,

                then this offset will be used for loans with a single term
                payment.
              type: integer
            twiceMonthly:
              description: >
                If the notification type has `trigger=loanOverdue` and
                `isDueDatesAvailableTwiceMonthly` is true on this loan type,

                then this offset will be used for loans with twice monthly
                payments.
              type: integer
            weekly:
              description: >
                If the notification type has `trigger=loanOverdue` and
                `isDueDatesAvailableWeekly` is true on this loan type,

                then this offset will be used for loans with weekly payments.
              type: integer
          type: object
    RepaymentNotificationTypeWithoutSubject:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            companyId:
              description: The company identifier for this notification type.
              readOnly: true
              type: string
            dayType:
              $ref: '#/components/schemas/DayType'
            daysOffsetDueDate:
              $ref: '#/components/schemas/DaysOffsetDueDate'
            loanOverdueWindow:
              description: >
                **DEPRECATED ATTRIBUTE** Window in which to start sending this
                notification. Only used for `trigger=loanOverdue`.
              properties:
                from:
                  description: >
                    Days after the loan is overdue to start sending this
                    notification type.
                  example: 0
                  type: integer
                to:
                  description: >
                    Days after the loan is overdue to stop sending this
                    notification type.
                  example: 30
                  type: integer
              readOnly: true
              required:
                - from
                - to
              type: object
            loanTypeAssetName:
              type: string
            productId:
              type: string
            promoType:
              description: >-
                Only used for notifications with subject `promoProgramReminder`
                and `promoProgramEligibilityAtRisk`
              enum:
                - sameAsCash
              nullable: true
              type: string
            sendChannels:
              default:
                - email
                - text
              description: >
                The channels to send the notification to. By default, the
                notification is sent to `text` and `email`

                channels.


                The system always attempts to send to *all* specified channels.
                As long as at least one contact of the 

                specified channels is available to send to then the notification
                will considered successful. An error is

                thrown if all three channels are unavailable for the borrower.
              items:
                $ref: '#/components/schemas/ValidInteractionChannel'
              type: array
            status:
              enum:
                - active
                - inactive
              type: string
            trigger:
              $ref: '#/components/schemas/RepaymentNotificationTrigger'
          type: object
    RepaymentNotificationType:
      allOf:
        - properties:
            subject:
              $ref: '#/components/schemas/RepaymentEngineInteractionSubject'
          type: object
        - $ref: '#/components/schemas/RepaymentNotificationTypeWithoutSubject'
    ResponseEndDate:
      description: >
        The end date of the promise to pay plan, equal to the `dueDate` of
        plan's last promise period.
      format: date
      type: string
    ExternalId:
      description: >
        A lender's identifier for a promise to pay plan.

        After the object is successfully created, a lender can use ID or
        externalId identifiers to fetch the object.

        To fetch the object using externalId you need to add `ext-` to the URL.

        Note: Don't add ext- to the identifier value. For example: if the
        external identifier is `ABCDE`, then pass 

        externalId=ACBCE and NOT ext-ABCDE when creating the object.
      nullable: true
      type: string
    ResponseStartDate:
      description: >
        The start date of the promise to pay plan, equal to the `startDate` of
        plan's first promise period.
      format: date
      type: string
    PromiseToPayPlan:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            cancellationReason:
              description: >
                The reason for canceling the promise to pay plan.


                `canceledByUser` - Promise to pay plan was canceled by an agent
                or borrower.

                `loanChargedOff` - loan was charged off during the promise
                period.

                `loanAccelerated` - loan was accelerated during the promise
                period.

                `otherPromisePlanOffered` - another promise plan was offered.

                `other` - for any other reason requiring cancellation.
              enum:
                - canceledByUser
                - loanChargedOff
                - loanAccelerated
                - otherPromisePlanOffered
                - other
              nullable: true
              type: string
            caseId:
              description: The ID of the case associated with the promise to pay plan.
              nullable: true
              type: string
            companyId:
              description: The unique company identifier.
              type: string
            endDate:
              $ref: '#/components/schemas/ResponseEndDate'
            externalId:
              $ref: '#/components/schemas/ExternalId'
            id:
              description: The promise to pay plan ID.
              type: string
            isOverdue:
              description: >-
                The borrower has not met one or more promised amounts by the
                promised due date.
              type: boolean
            loanId:
              description: The unique loan identifier that the promise belongs to.
              type: string
            object:
              default: promiseToPayPlan
              enum:
                - promiseToPayPlan
              readOnly: true
              type: string
            reasonDetails:
              description: >-
                Additional details about the reason for canceling the promise to
                pay plan.
              nullable: true
              type: string
            schedule:
              description: Promise to pay plan periodId(s) and amount(s).
              items:
                allOf:
                  - $ref: '#/components/schemas/BaseMixin'
                  - properties:
                      amount:
                        description: Amount of the promise to pay period.
                        format: float
                        type: number
                      dueDate:
                        description: The due date of the promised amount.
                        format: date
                        type: string
                      object:
                        default: promisePeriod
                        enum:
                          - promisePeriod
                        readOnly: true
                        type: string
                      periodId:
                        description: >-
                          Unique identifier of the period created for the
                          promise to pay plan.
                        type: string
                      startDate:
                        description: The period start date.
                        format: date
                        type: string
                    type: object
              type: array
            startDate:
              $ref: '#/components/schemas/ResponseStartDate'
            status:
              description: >
                The status of the promise to pay plan. 


                `scheduled` - promise to pay has been created but has not yet
                started. Typically used when the lender wants to 

                start a promise as of a specific date. Communications will not
                be triggered and tasks will not be assigned to 

                agents for promise to pay plans in `scheduled` status. Peach's
                system will transition the status of the promise

                to pay plan to `active` on the `startDate` unless the lender
                cancels the promise to pay beforehand. 


                `active` - promise to pay plan is in effect. To check if the
                borrower is on and behind the schedule, see the `

                isOverdue` attribute.


                `kept` - promise to pay final period end date has passed and the
                borrower has met the promised amount(s) by the 

                promise's final period end date. This status is a terminal
                state.


                `broken` - promise to pay final period end date has passed and
                the borrower has not met the promised amount(s) 

                by the promise's final period end date. This status is a
                terminal state.


                `canceled` - promise to pay plan was canceled. This status is a
                terminal state.
              enum:
                - scheduled
                - active
                - kept
                - broken
                - canceled
              type: string
          type: object
    Merchant:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            address:
              $ref: '#/components/schemas/AddressBase'
              description: The mailing address.
            businessName:
              description: |
                The business name of the merchant. Can be displayed in UI.
              type: string
            businessTypeDisplayName:
              description: |
                The business type/description as shown to borrowers. For
                example: 'Merchant', 'Dealer', or 'Venue'. Defaults to
                'Merchant' if no value is provided.
              type: string
            disputesContactEmail:
              description: |
                The email of the merchant's disputes department.
              maxLength: 320
              type: string
            disputesContactName:
              description: |
                The name of the merchant's disputes department.
              maxLength: 256
              type: string
            disputesContactPhone:
              description: |
                The phone number of the merchant's disputes department.
              maxLength: 15
              type: string
            externalId:
              description: |
                A lender's identifier for the merchant.
              type: string
            parentMerchantId:
              description: >
                The parent merchant identifier. Used to represent hierarchy of
                merchant sub entities.

                Can be Peach or lender's external identifier.
              nullable: true
              type: string
            primaryContactEmail:
              description: >
                The email of the merchant's primary contact person or
                department.
              maxLength: 320
              type: string
            primaryContactName:
              description: |
                The name of the merchant's primary contact person or department.
              maxLength: 256
              type: string
            primaryContactPhone:
              description: >
                The phone number of the merchant's primary contact person or
                department.
              maxLength: 15
              type: string
            subEntityname:
              description: >
                The sub entity business name of the merchant. For example:
                Online Sephora.
              type: string
          type: object
    fileName:
      description: |
        The name of the ACH file.
      minLength: 1
      type: string
    AchFileUploadDetails:
      allOf:
        - properties:
            uploadFailedAt:
              description: |
                The datetime when the upload of the ACH file failed.
              format: date-time
              nullable: true
              type: string
            uploadNumberOfRetries:
              default: 0
              description: |
                The number of upload retries for the ACH file.
              minimum: 0
              nullable: true
              type: integer
            uploadStartedAt:
              description: |
                The datetime when the upload of the ACH file began.
              format: date-time
              nullable: true
              type: string
            uploadSucceededAt:
              description: >
                The datetime when the upload of the ACH file finished
                successfully.
              format: date-time
              nullable: true
              type: string
          type: object
    AchFileMutableFields:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            fileName:
              $ref: '#/components/schemas/fileName'
            gcp:
              allOf:
                - $ref: '#/components/schemas/AchFileUploadDetails'
              description: GCP Storage upload details
            isSettlement:
              default: false
              description: >
                - If true, the file contains only settlement transactions with
                investors. These files
                  are generated only for the Peach payment processor as part of automated investor
                  reconciliation; third-party processors do not produce settlement ACH files.
                - If false, the file contains only transactions with borrowers.
              type: boolean
            numberOfMicrodeposits:
              default: 0
              description: |
                The number of microdeposits included in this ACH file.
              minimum: 0
              type: integer
            numberOfTransactions:
              default: 0
              description: |
                The number of transactions included in this ACH file.
              minimum: 0
              type: integer
            sftp:
              allOf:
                - $ref: '#/components/schemas/AchFileUploadDetails'
              description: SFTP Server upload details
          type: object
    AchFile:
      allOf:
        - type: object
        - $ref: '#/components/schemas/AchFileMutableFields'
      required:
        - fileName
      title: ACH File
    FundingInstrument:
      allOf:
        - $ref: '#/components/schemas/BankAccount'
        - $ref: '#/components/schemas/bankAccountAccountNumber'
        - properties:
            baiBalanceCheck:
              properties:
                bypass:
                  type: boolean
              required:
                - bypass
              type: object
            verified:
              readOnly: true
          type: object
    FundingInstrumentMutable:
      allOf:
        - $ref: '#/components/schemas/BankAccountMutable'
        - type: object
    WorkflowStepStatus:
      enum:
        - due
        - approved
        - rejected
        - skipped
      type: string
    CaseApprovalConditions:
      description: |
        Set of steps' statuses that must be met before case outcome can be set
        to approved. Currently, we support "and" only between the steps.
      items:
        properties:
          stepStatus:
            $ref: '#/components/schemas/WorkflowStepStatus'
          stepTypeRefId:
            format: uuid
            type: string
        type: object
      nullable: true
      type: array
    DecisionQuestionType:
      enum:
        - yesNo
        - approveReject
      type: string
    StatusChangeHistory:
      description: |
        The status change history of workflow steps and work items.
      items:
        additionalProperties: false
        properties:
          status:
            type: string
          time:
            format: date-time
            type: string
          user:
            type: integer
        type: object
      type: array
    StepVisibility:
      enum:
        - normal
        - closingApproved
        - closingDenied
        - closingFalsePositive
        - closingNoOutcome
      type: string
    WorkflowWorkitemStatus:
      enum:
        - due
        - completed
        - skipped
      type: string
    WorkflowWorkitem:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            completedAt:
              format: date-time
              nullable: true
              type: string
            descriptionLong:
              nullable: true
              type: string
            descriptionShort:
              type: string
            history:
              $ref: '#/components/schemas/StatusChangeHistory'
            object:
              default: workflowWorkitem
              enum:
                - workflowWorkitem
              readOnly: true
              type: string
            skippedAt:
              format: date-time
              nullable: true
              type: string
            status:
              $ref: '#/components/schemas/WorkflowWorkitemStatus'
            updatedBy:
              $ref: '#/components/schemas/UserActionInfo'
              description: |
                Details of the user who last updated this work item.
                Can be an agent or automated system process.
            workflowStepId:
              type: string
            workflowWorkitemTypeId:
              type: string
          type: object
    WorkflowStep:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            completedAt:
              format: date-time
              nullable: true
              type: string
            decisionQuestion:
              description: |
                Decision question that leads to the outcome of the step.
              type: string
            decisionQuestionType:
              $ref: '#/components/schemas/DecisionQuestionType'
            descriptionLong:
              description: |
                Additional details on how to complete the step.
              nullable: true
              type: string
            descriptionShort:
              description: |
                A short description of the step. Displayed to agents in the UI.
              type: string
            history:
              $ref: '#/components/schemas/StatusChangeHistory'
            mandatory:
              type: boolean
            object:
              default: workflowStep
              enum:
                - workflowStep
              readOnly: true
              type: string
            skippedAt:
              format: date-time
              nullable: true
              type: string
            status:
              $ref: '#/components/schemas/WorkflowStepStatus'
            updatedBy:
              $ref: '#/components/schemas/UserActionInfo'
              description: |
                Details of the user who last updated this workflow step.
                Can be an agent or automated system process.
            visibility:
              $ref: '#/components/schemas/StepVisibility'
            workItems:
              description: |
                List of work items that comprise this workflow step.
              items:
                $ref: '#/components/schemas/WorkflowWorkitem'
              type: array
            workflowId:
              type: string
            workflowStepTypeId:
              type: string
          type: object
    Workflow:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            approvalConditions:
              $ref: '#/components/schemas/CaseApprovalConditions'
            completedAt:
              format: date-time
              nullable: true
              type: string
            description:
              description: Description of the workflow.
              type: string
            name:
              description: |
                Short name of the workflow.
              type: string
            object:
              default: workflow
              enum:
                - workflow
              readOnly: true
              type: string
            steps:
              description: |
                List of workflow steps that comprise the workflow.
              items:
                $ref: '#/components/schemas/WorkflowStep'
              type: array
            workflowTypeId:
              type: string
          type: object
    LoanInvestorsPaging:
      allOf:
        - $ref: '#/components/schemas/Paging'
        - properties:
            data:
              $ref: '#/components/schemas/LoanInvestorsGet'
          type: object
    PromoProgramTypeFields:
      properties:
        archived:
          description: |
            Whether the promo program type has been archived. Derived from
            `status == archived`.
          readOnly: true
          type: boolean
        archivedAt:
          description: When the promo program type was archived.
          format: date-time
          readOnly: true
          type: string
        archivedBy:
          description: The identifier of the user who archived the promo program type.
          readOnly: true
          type: string
        createdAt:
          description: When the promo program type was created.
          format: date-time
          readOnly: true
          type: string
        deletedAt:
          description: When the promo program type was deleted, if applicable.
          format: date-time
          nullable: true
          readOnly: true
          type: string
        description:
          description: |
            A legal description of the promotional program as it should
            be communicated and shown to borrowers.
            If the description is provided, borrowers will see the
            description in the App / Borrower Portal and/or on
            statements.
          maxLength: 10000
          type: string
        displayName:
          description: |
            The promotional program name as it is shown to borrowers in
            the App / Borrower Portal and/or on statements.
          type: string
        externalId:
          description: |
            A lender's unique identifier for a specific promotional
            program type.
          type: string
        id:
          description: The promotional program type's unique identifier.
          readOnly: true
          type: string
        metaData:
          description: |
            Store any type of key/value pairs in the form of a JSON
            dictionary.
          nullable: true
          type: object
        status:
          default: draft
          description: |
            The promo type status.
            A new type is normally created in the `draft` status.
            When you are ready to offer the promotional program type on
            loans, update the status to `active`.

            Setting the status to `inactive` means the promotional program
            cannot be used on new loans. Loans in-flight will continue to be
            eligible. `deprecated` is the legacy equivalent of `inactive`:
            it is never returned in responses (such rows serialize as
            `inactive`) and is rejected as a write value.

            `archived` is a terminal state set via the archive (DELETE)
            endpoint, not via update. Archived types cannot be edited.
          enum:
            - draft
            - active
            - deprecated
            - inactive
            - archived
          type: string
        updatedAt:
          description: When the promo program type was last updated.
          format: date-time
          readOnly: true
          type: string
      type: object
    PromoProgramTypePaging:
      allOf:
        - $ref: '#/components/schemas/Paging'
        - properties:
            data:
              items:
                $ref: '#/components/schemas/PromoProgramTypeFields'
              type: array
          type: object
    PromoType:
      description: |
        The promotional program type.

        `sameAsCash` - presently only available for installment loans.

        `deferredInterest` - presently only available for Lines of
        Credit / Draws.
      enum:
        - sameAsCash
        - deferredInterest
      type: string
    PromoProgramTypePost:
      allOf:
        - required:
            - promoType
            - displayName
        - properties:
            promoType:
              $ref: '#/components/schemas/PromoType'
          type: object
        - $ref: '#/components/schemas/PromoProgramTypeFields'
      description: Create a promo program type
    PromoProgramTypePut:
      allOf:
        - $ref: '#/components/schemas/PromoProgramTypeFields'
      description: Create a promo program type
    SupercaseType:
      description: >
        The different types of supercases.


        Note that `supercaseType` is different from `subcaseType`. A
        `supercaseType` describes

        the type of the supercase and cannot be changed after supercase
        creation.
      enum:
        - generic
        - federalEmergency
      type: string
    TaskWorkerPairingConfig:
      properties:
        companyId:
          readOnly: true
          type: string
        createdAt:
          format: date-time
          nullable: true
          readOnly: true
          type: string
        deletedAt:
          format: date-time
          nullable: true
          readOnly: true
          type: string
        externalId:
          nullable: true
          type: string
        id:
          readOnly: true
          type: string
        isDefault:
          description: >
            If `true` this pairing config is the default for the company. Only
            one pairing config

            can be the default at a time.
          readOnly: true
          type: boolean
        name:
          description: |
            A human-readable name for this pairing config.
          type: string
        object:
          readOnly: true
          type: string
        overrideTwilioTaskWorkflowExpression:
          description: >
            If the characteristics of the tasks you wish to match cannot be
            fully described by the 

            `taskMatch` object, you can override the Twilio "TaskRouter
            expression" used

            to match the workers by settings this field. (In which case you will
            see the

            value set here in the field `twilioTaskWorkflowExpression` as well.)


            This field's syntax must conform to the Twilio "TaskRouter
            Expression" syntax[1].


            Since this syntax is not validated here, it may be difficult to
            debug invalid

            expressions; as such, it is recommended you use the `taskMatch`
            object when possible.


            Some useful expression examples for TaskRouter task attributes:
              
            - Matching a task with an email interaction which was sent to the
            email
              address `support@loans.acme.com`.
              `interaction.channel = "email" AND "support@loans.acme.com" IN interactionMeta.recipients.emails`
            - Matching an inbound phone call to a particular support phone
            number `+15555555555`: 
              `interaction.channel = "voice" AND interactionMeta.to.phone = "+15555555555"`

            [1] https://www.twilio.com/docs/taskrouter/expression-syntax
          type: string
        overrideTwilioWorkerQueueExpression:
          description: >
            If the characteristics of the workers you wish to match cannot be
            fully described by the 

            `workerMatch` object, you can override the Twilio "TaskRouter
            expression" used

            to match the workers by settings this field. (In which case you will
            see the

            value set here in the field `twilioWorkerQueueExpression` as well.)


            This field's syntax must conform to the Twilio "TaskRouter
            Expression" syntax[1].


            Since this syntax is not validated here, it may be difficult to
            debug invalid

            expressions; as such, it is recommended you use the `workerMatch`
            object when possible.


            [1] https://www.twilio.com/docs/taskrouter/expression-syntax
          type: string
        priority:
          description: >
            The order in which this pairing config should be evaluated. Higher
            numbers are evaluated first.


            Note that the default pairing config is always evaluated LAST (and
            it's `priority` is always `null`.)
          nullable: true
          type: integer
        taskMatch:
          properties:
            case:
              properties:
                autocreated:
                  description: >
                    If `true` only match tasks with autocreated cases. If
                    `false` match not-autocreated cases. If `null` match any.
                  nullable: true
                  type: boolean
                caseTypeEnums:
                  description: >
                    List of `caseType`; match any task with a case with a case
                    type matching in the list.

                    Note this field is different from `caseTypeIds`, which
                    matches on specific case type instance rather than the case
                    type enum. If `null` match any case.
                  items:
                    $ref: '#/components/schemas/BaseCaseType'
                  nullable: true
                  type: array
                caseTypeIds:
                  description: >
                    List of case type IDs; match any task with a case with a
                    case type present in the list.

                    Note this field is different from `caseTypeEnums`, which
                    matches on case type enum rather than a specific case type
                    instance. If `null` match any.
                  items:
                    type: string
                  nullable: true
                  type: array
              type: object
            interaction:
              properties:
                channels:
                  description: >
                    List of `interactionChannel`. Match any task with an
                    `interaction` which has an `channel` present in the list. If
                    `null` match any.
                  items:
                    $ref: '#/components/schemas/InteractionChannel'
                  nullable: true
                  type: array
                directions:
                  description: >
                    List of `interactionDirections`. Match any task with an
                    `interaction` which has an `direction` present in the list.
                    If `null` match any.
                  items:
                    $ref: '#/components/schemas/InteractionDirection'
                  nullable: true
                  type: array
                subjects:
                  description: >
                    List of `interactionSubject`. Match any task with an
                    `interaction` which has an `subject` present in the list. If
                    `null` match any.
                  items:
                    $ref: '#/components/schemas/InteractionSubject'
                  nullable: true
                  type: array
                themes:
                  description: >
                    List of `interactionTheme`. Match any task with an
                    `interaction` which has an `theme` present in the list. If
                    `null` match any.
                  items:
                    $ref: '#/components/schemas/InteractionTheme'
                  nullable: true
                  type: array
              type: object
            not:
              description: >
                If `true` then match tasks NOT matching those specified in this
                `taskMatch` object.


                (Look in the `twilioWorkerQueueExpression` to see each
                individual expression clause

                `NOT`-ed when this is set.)
              nullable: true
              type: boolean
            supercase:
              properties:
                supercaseTypeEnums:
                  description: >
                    List of `supercaseType`; match any task with a supercase
                    with a supercase type matching in the list.

                    If `null` match any task.
                  items:
                    $ref: '#/components/schemas/SupercaseType'
                  nullable: true
                  type: array
              type: object
            taskTypes:
              items:
                $ref: '#/components/schemas/TaskType'
              nullable: true
              type: array
          type: object
        twilioTaskWorkflowExpression:
          description: >
            The Twilio "TaskRouter Expression" string used to match tasks.


            This field is read-only because it's generated by configuring

            the `taskMatch` object, or it's set via the
            `overrideTwilioTaskWorkflowExpression`

            field.
          readOnly: true
          type: string
        twilioWorkerQueueExpression:
          description: >
            The Twilio "TaskRouter expression" string used to match workers.


            This field is read-only because it's generated by configuring

            the `workerMatch` object, or it is set via the
            `overrideTwilioWorkerQueueExpression`

            field.
          readOnly: true
          type: string
        updatedAt:
          format: date-time
          nullable: true
          readOnly: true
          type: string
        workerMatch:
          description: >
            An object describing the characteristics of the workers to match to
            the tasks 

            matched in `taskMatch`.


            The settings here are translated into Twilio "expression syntax"[1]
            and matched against

            the workers' attributes. You can see the generated expression in the
            field 

            `twilioWorkerQueueExpression`.


            [1] https://www.twilio.com/docs/taskrouter/expression-syntax
          properties:
            isManager:
              description: >
                If `true` match only manager employees. If `false` match only
                non-manager employees. If `null`

                match any.
              nullable: true
              type: boolean
            roleIds:
              description: >
                List of role IDs; match any employee which belongs to at least
                one of these roles. If `null` match any.
              items:
                type: string
              nullable: true
              type: array
            teamIds:
              description: >
                List of team IDs; match any employee which belongs to at least
                one of these teams. If `null` match any.
              items:
                type: string
              nullable: true
              type: array
          type: object
      type: object
    TaskWorkerPairingConfigPaging:
      allOf:
        - $ref: '#/components/schemas/Paging'
        - properties:
            data:
              items:
                $ref: '#/components/schemas/TaskWorkerPairingConfig'
              type: array
          type: object
    QueueWaitSplitInnerStatistics:
      properties:
        above:
          properties:
            reversations_accepted:
              type: number
            tasks_canceled:
              type: number
          type: object
        below:
          properties:
            reversations_accepted:
              type: number
            tasks_canceled:
              type: number
          type: object
      type: object
    QueueWaitSplitStatistics:
      nullable: true
      properties:
        '5':
          $ref: '#/components/schemas/QueueWaitSplitInnerStatistics'
        '10':
          $ref: '#/components/schemas/QueueWaitSplitInnerStatistics'
      type: object
    QueueWaitDurationStatistics:
      properties:
        avg:
          type: number
        max:
          type: number
        min:
          type: number
        total:
          type: number
      type: object
    QueueActivityStatistics:
      properties:
        friendly_name:
          type: string
        sid:
          type: string
        workers:
          type: integer
      type: object
    TaskQueueData:
      properties:
        account_sid:
          type: string
        assignment_activity_name:
          nullable: true
          type: string
        assignment_activity_sid:
          nullable: true
          type: string
        cumulative_statistics:
          properties:
            avg_task_acceptance_time:
              type: number
            end_time:
              format: date-time
              type: string
            reservations_accepted:
              type: integer
            reservations_canceled:
              type: integer
            reservations_created:
              type: integer
            reservations_rejected:
              type: integer
            reservations_rescinded:
              type: integer
            reservations_timed_out:
              type: integer
            split_by_wait_time:
              $ref: '#/components/schemas/QueueWaitSplitStatistics'
            start_time:
              format: date-time
              type: string
            tasks_canceled:
              type: integer
            tasks_completed:
              type: integer
            tasks_deleted:
              type: integer
            tasks_entered:
              type: integer
            tasks_moved:
              type: integer
            wait_duration_in_queue_until_accepted:
              $ref: '#/components/schemas/QueueWaitDurationStatistics'
            wait_duration_until_accepted:
              $ref: '#/components/schemas/QueueWaitDurationStatistics'
            wait_duration_until_canceled:
              $ref: '#/components/schemas/QueueWaitDurationStatistics'
          type: object
        date_created:
          format: date-time
          type: string
        date_updated:
          format: date-time
          type: string
        friendly_name:
          type: string
        max_reserved_workers:
          type: integer
        real_time_statistics:
          properties:
            activity_statistics:
              items:
                $ref: '#/components/schemas/QueueActivityStatistics'
              type: array
            longest_relative_task_age_in_queue:
              type: integer
            longest_relative_task_sid_in_queue:
              nullable: true
              type: string
            longest_task_waiting_age:
              type: integer
            longest_task_waiting_sid:
              nullable: true
              type: string
            tasks_by_priority:
              type: object
            tasks_by_status:
              properties:
                assigned:
                  type: integer
                canceled:
                  type: integer
                pending:
                  type: integer
                reserved:
                  type: integer
                wrapping:
                  type: integer
              type: object
            total_available_workers:
              type: integer
            total_eligible_workers:
              type: integer
            total_tasks:
              type: integer
          type: object
        reservation_activity_name:
          nullable: true
          type: string
        reservation_activity_sid:
          nullable: true
          type: string
        sid:
          nullable: true
          type: string
        target_workers:
          nullable: true
          type: string
        task_order:
          type: string
        workspace_sid:
          type: string
      type: object
    TaskAssignmentStatus:
      enum:
        - pending
        - reserved
        - assigned
        - wrapping
        - completed
        - canceled
      type: string
    TaskAttributesBase:
      description: >
        The attributes of the task. These are the "content" of the task, which
        describe

        the work to be done.
      properties:
        task_init_at:
          description: >
            The date and time the original task was created. This is the time
            the original task was created, not 

            the time the task was re-created, if it was re-created.
          type: string
        task_lifelong_id:
          description: >
            A unique identifier for the task that is guaranteed to be the same
            over the lifetime of the task

            event if the task is re-created via the "Unable To Complete"
            functionality.
          type: string
      type: object
    LoanTypesForTask:
      items:
        properties:
          ids:
            example:
              - LT-AAAA-BBBB
            items:
              type: string
            type: array
          names:
            example:
              - Foobar Installment Loan
            items:
              type: string
            type: array
          types:
            items:
              enum:
                - installment
                - lineOfCredit
              type: string
            type: array
        type: object
      type: array
    BorrowerForTask:
      description: |
        The metadata of the borrower about which this task is the subject.
      properties:
        id:
          description: |
            The unique identifier for the borrower.
          example: BO-AAAA-BBBB
          type: string
        loanTypes:
          $ref: '#/components/schemas/LoanTypesForTask'
          description: |
            Type information about ALL the loans associated with this borrower.
        name:
          description: |
            The full name of the borrower.
          type: string
      type: object
    TwilioMinimalInteraction:
      allOf:
        - $ref: '#/components/schemas/BaseTwilioMinimalInteraction'
        - properties:
            previousInteractionSubject:
              $ref: '#/components/schemas/InteractionSubject'
            previousInteractionTheme:
              $ref: '#/components/schemas/InteractionTheme'
          type: object
    TaskAttributesAnswerInboundVoiceCall:
      allOf:
        - $ref: '#/components/schemas/TaskAttributesBase'
        - properties:
            account_sid:
              type: string
            api_version:
              type: string
            borrower:
              allOf:
                - nullable: true
                  type: object
                - $ref: '#/components/schemas/BorrowerForTask'
            call_sid:
              type: string
            called:
              type: string
            called_city:
              type: string
            called_country:
              type: string
            called_state:
              type: string
            called_zip:
              type: string
            caller:
              type: string
            caller_city:
              type: string
            caller_country:
              type: string
            caller_state:
              type: string
            caller_zip:
              type: string
            case:
              description: Always `null`
              nullable: true
              type: object
            direction:
              type: string
            from:
              type: string
            from_city:
              type: string
            from_country:
              type: string
            from_state:
              type: string
            from_zip:
              type: string
            interaction:
              $ref: '#/components/schemas/TwilioMinimalInteraction'
            task_type:
              enum:
                - answerInboundVoiceCall
              type: string
            to:
              type: string
            to_city:
              type: string
            to_country:
              type: string
            to_state:
              type: string
            to_zip:
              type: string
          type: object
    CaseForTask:
      description: >
        The case object associated with this task.


        Note that this represents the case data at the moment the task was
        published,

        if subsequent changes have been made to the case, they will not be
        reflected here.
      properties:
        autoCreated:
          type: boolean
        borrowerIds:
          items:
            type: string
          type: array
        caseType:
          $ref: '#/components/schemas/BaseCaseType'
        caseTypeMeta:
          description: |
            Metadata about the case type object.
          properties:
            base:
              type: string
            derivedFromTypeId:
              nullable: true
              type: string
            id:
              type: string
            name:
              type: string
            version:
              type: integer
          type: object
        companyId:
          type: string
        createdAt:
          format: date-time
          type: string
        escalatedEmployeeId:
          nullable: true
          type: string
        escalatedTeamId:
          description: The ID of the team to which this case is escalated.
          nullable: true
          type: string
        escalationIsUrgent:
          description: >
            If `true` then the case is considered "urgent" and should be handled
            with priority.
          nullable: true
          type: boolean
        id:
          description: ID of the case.
          type: string
        loanTypes:
          $ref: '#/components/schemas/LoanTypesForTask'
          description: |
            Type information about just the loans associated with this case.
          nullable: true
        name:
          type: string
        outcome:
          $ref: '#/components/schemas/ProcessOutcome'
        owningUserId:
          nullable: true
          type: string
        people:
          items:
            type: string
          type: array
        relatedLoansSummary:
          properties:
            isAnyOverdue:
              type: boolean
            maxDaysOverdue:
              type: integer
            totalOverdueAmount:
              type: integer
          type: object
        status:
          type: string
        typeId:
          description: ID of the case type.
          type: string
      type: object
    TaskAttributesHandleInboundInteraction:
      allOf:
        - $ref: '#/components/schemas/TaskAttributesBase'
        - properties:
            borrower:
              $ref: '#/components/schemas/BorrowerForTask'
            case:
              $ref: '#/components/schemas/CaseForTask'
              nullable: true
            interaction:
              $ref: '#/components/schemas/TwilioMinimalInteraction'
            task_type:
              enum:
                - handleInboundInteraction
              type: string
          type: object
    TaskAttributesHandleUnboundInboundInteraction:
      allOf:
        - $ref: '#/components/schemas/TaskAttributesBase'
        - properties:
            borrower:
              description: Always `null`
              nullable: true
              type: object
            case:
              $ref: '#/components/schemas/CaseForTask'
              nullable: true
            interaction:
              $ref: '#/components/schemas/TwilioMinimalInteraction'
            task_type:
              enum:
                - handleUnboundInboundInteraction
              type: string
          type: object
    TaskAttributesMakeScheduledCall:
      allOf:
        - $ref: '#/components/schemas/TaskAttributesBase'
        - properties:
            borrower:
              $ref: '#/components/schemas/BorrowerForTask'
            case:
              allOf:
                - nullable: true
                  type: object
                - $ref: '#/components/schemas/CaseForTask'
            interaction:
              $ref: '#/components/schemas/TwilioMinimalInteraction'
            task_type:
              enum:
                - makeScheduledCall
              type: string
          type: object
    TaskAttributesReplyToNewText:
      allOf:
        - $ref: '#/components/schemas/TaskAttributesBase'
        - properties:
            borrower:
              allOf:
                - nullable: true
                  type: object
                - $ref: '#/components/schemas/BorrowerForTask'
            case:
              description: Always `null`
              nullable: true
              type: object
            interaction:
              $ref: '#/components/schemas/TwilioMinimalInteraction'
            task_type:
              enum:
                - replyToNewText
              type: string
          type: object
    TaskAttributesReplyToNewWebChat:
      allOf:
        - $ref: '#/components/schemas/TaskAttributesBase'
        - properties:
            borrower:
              $ref: '#/components/schemas/BorrowerForTask'
            case:
              description: Always `null`
              nullable: true
              type: object
            interaction:
              $ref: '#/components/schemas/TwilioMinimalInteraction'
            task_type:
              enum:
                - replyToNewWebChat
              type: string
          type: object
    TaskAttributesReplyToAbandonedWebChat:
      allOf:
        - $ref: '#/components/schemas/TaskAttributesBase'
        - properties:
            borrower:
              $ref: '#/components/schemas/BorrowerForTask'
            case:
              allOf:
                - nullable: true
                  type: object
                - $ref: '#/components/schemas/CaseForTask'
            interaction:
              $ref: '#/components/schemas/TwilioMinimalInteraction'
            task_type:
              enum:
                - replyToAbandonedWebChat
              type: string
          type: object
    TaskAttributesReviewEscalatedCaseAgent:
      allOf:
        - $ref: '#/components/schemas/TaskAttributesBase'
        - properties:
            borrower:
              allOf:
                - nullable: true
                  type: object
                - $ref: '#/components/schemas/BorrowerForTask'
            case:
              $ref: '#/components/schemas/CaseForTask'
            interaction:
              description: Always `null`
              nullable: true
              type: object
            task_type:
              enum:
                - reviewEscalatedCaseAgent
              type: string
          type: object
    TaskAttributesReviewEscalatedCaseAgentUrgent:
      allOf:
        - $ref: '#/components/schemas/TaskAttributesBase'
        - properties:
            borrower:
              allOf:
                - nullable: true
                  type: object
                - $ref: '#/components/schemas/BorrowerForTask'
            case:
              $ref: '#/components/schemas/CaseForTask'
            interaction:
              description: Always `null`
              nullable: true
              type: object
            task_type:
              enum:
                - reviewEscalatedCaseAgentUrgent
              type: string
          type: object
    TaskAttributesReviewEscalatedCaseTeam:
      allOf:
        - $ref: '#/components/schemas/TaskAttributesBase'
        - properties:
            borrower:
              allOf:
                - nullable: true
                  type: object
                - $ref: '#/components/schemas/BorrowerForTask'
            case:
              $ref: '#/components/schemas/CaseForTask'
            interaction:
              description: Always `null`
              nullable: true
              type: object
            task_type:
              enum:
                - reviewEscalatedCaseTeam
              type: string
          type: object
    TaskAttributesReviewEscalatedCaseTeamUrgent:
      allOf:
        - $ref: '#/components/schemas/TaskAttributesBase'
        - properties:
            borrower:
              allOf:
                - nullable: true
                  type: object
                - $ref: '#/components/schemas/BorrowerForTask'
            case:
              $ref: '#/components/schemas/CaseForTask'
            interaction:
              description: Always `null`
              nullable: true
              type: object
            task_type:
              enum:
                - reviewEscalatedCaseTeamUrgent
              type: string
          type: object
    TaskAttributesReviewDocumentUpload:
      allOf:
        - $ref: '#/components/schemas/TaskAttributesBase'
        - properties:
            borrower:
              $ref: '#/components/schemas/BorrowerForTask'
            case:
              allOf:
                - nullable: true
                  type: object
                - $ref: '#/components/schemas/CaseForTask'
            interaction:
              description: Always `null`
              nullable: true
              type: object
            task_type:
              enum:
                - reviewDocumentUpload
              type: string
          type: object
    TaskAttributesReviewSnoozedCase:
      allOf:
        - $ref: '#/components/schemas/TaskAttributesBase'
        - properties:
            borrower:
              allOf:
                - nullable: true
                  type: object
                - $ref: '#/components/schemas/BorrowerForTask'
            case:
              $ref: '#/components/schemas/CaseForTask'
            interaction:
              description: Always `null`
              nullable: true
              type: object
            task_type:
              enum:
                - reviewSnoozedCase
              type: string
          type: object
    TaskAttributesReviewAutoCreatedCase:
      allOf:
        - $ref: '#/components/schemas/TaskAttributesBase'
        - properties:
            borrower:
              allOf:
                - nullable: true
                  type: object
                - $ref: '#/components/schemas/BorrowerForTask'
            case:
              $ref: '#/components/schemas/CaseForTask'
            interaction:
              description: Always `null`
              nullable: true
              type: object
            task_type:
              enum:
                - reviewAutoCreatedCase
              type: string
          type: object
    TaskAttributesReviewAutoUpdatedCase:
      allOf:
        - $ref: '#/components/schemas/TaskAttributesBase'
        - properties:
            borrower:
              allOf:
                - nullable: true
                  type: object
                - $ref: '#/components/schemas/BorrowerForTask'
            case:
              $ref: '#/components/schemas/CaseForTask'
            interaction:
              description: Always `null`
              nullable: true
              type: object
            task_type:
              enum:
                - reviewAutoUpdatedCase
              type: string
          type: object
    TaskAttributesReviewCaseInstructions:
      allOf:
        - $ref: '#/components/schemas/TaskAttributesBase'
        - properties:
            borrower:
              allOf:
                - nullable: true
                  type: object
                - $ref: '#/components/schemas/BorrowerForTask'
            case:
              $ref: '#/components/schemas/CaseForTask'
            interaction:
              description: Always `null`
              nullable: true
              type: object
            task_type:
              enum:
                - reviewCaseInstructions
              type: string
          type: object
    TaskAttributesReviewVoicemail:
      allOf:
        - $ref: '#/components/schemas/TaskAttributesBase'
        - properties:
            borrower:
              allOf:
                - nullable: true
                  type: object
                - $ref: '#/components/schemas/BorrowerForTask'
            case:
              description: Always `null`
              nullable: true
              type: object
            interaction:
              $ref: '#/components/schemas/TwilioMinimalInteraction'
            task_type:
              enum:
                - reviewVoicemail
              type: string
          type: object
    TaskAttributesSmartReviewCase:
      allOf:
        - $ref: '#/components/schemas/TaskAttributesBase'
        - properties:
            borrower:
              allOf:
                - nullable: true
                  type: object
                - $ref: '#/components/schemas/BorrowerForTask'
            case:
              $ref: '#/components/schemas/CaseForTask'
            interaction:
              description: Always `null`
              nullable: true
              type: object
            task_type:
              enum:
                - smartReviewCase
              type: string
          type: object
    Task:
      properties:
        account_sid:
          description: The unique identifier for the Twilio account.
          type: string
        addons:
          description: Currently unused.
          type: string
        age:
          description: |
            Time since this task was created in seconds.
          type: integer
        assignment_status:
          $ref: '#/components/schemas/TaskAssignmentStatus'
        attributes:
          oneOf:
            - $ref: '#/components/schemas/TaskAttributesAnswerInboundVoiceCall'
            - $ref: '#/components/schemas/TaskAttributesHandleInboundInteraction'
            - $ref: >-
                #/components/schemas/TaskAttributesHandleUnboundInboundInteraction
            - $ref: '#/components/schemas/TaskAttributesMakeScheduledCall'
            - $ref: '#/components/schemas/TaskAttributesReplyToNewText'
            - $ref: '#/components/schemas/TaskAttributesReplyToNewWebChat'
            - $ref: '#/components/schemas/TaskAttributesReplyToAbandonedWebChat'
            - $ref: '#/components/schemas/TaskAttributesReviewEscalatedCaseAgent'
            - $ref: >-
                #/components/schemas/TaskAttributesReviewEscalatedCaseAgentUrgent
            - $ref: '#/components/schemas/TaskAttributesReviewEscalatedCaseTeam'
            - $ref: '#/components/schemas/TaskAttributesReviewEscalatedCaseTeamUrgent'
            - $ref: '#/components/schemas/TaskAttributesReviewDocumentUpload'
            - $ref: '#/components/schemas/TaskAttributesReviewSnoozedCase'
            - $ref: '#/components/schemas/TaskAttributesReviewAutoCreatedCase'
            - $ref: '#/components/schemas/TaskAttributesReviewAutoUpdatedCase'
            - $ref: '#/components/schemas/TaskAttributesReviewCaseInstructions'
            - $ref: '#/components/schemas/TaskAttributesReviewVoicemail'
            - $ref: '#/components/schemas/TaskAttributesSmartReviewCase'
        date_created:
          description: >
            The date and time the task was created. (Potentially this differs
            from the `task_init_at` field in 

            the task's attributes, since when a task is re-created via the
            "Unable To Complete" functionality, 

            this value will be the time the task was re-created.)
          format: date-time
          type: string
        date_updated:
          format: date-time
          type: string
        priority:
          description: >
            The priority of the task. A higher priority task jumps the queue
            ahead of lower priority tasks.

            By default, tasks have a priority of 0. For example, inbound texts
            and chats may be configured

            to have a higher priority. And usually, calls will have an even
            higher priority.
          type: integer
        reason:
          description: Reason for task cancellation or completion, if applicable.
          nullable: true
          type: string
        reservation:
          nullable: true
          type: string
        sid:
          description: The unique identifier for the task.
          type: string
        task_channel_sid:
          description: The SID of the channel this task is associated with.
          type: string
        task_channel_unique_name:
          description: The unique name of the channel this task is associated with.
          type: string
        task_queue_entered_date:
          description: The date and time the task entered the queue.
          format: date-time
          type: string
        task_queue_friendly_name:
          description: A human-readable name for the task queue.
          type: string
        task_queue_sid:
          description: The SID of the queue this task is associated with.
          type: string
        timeout:
          description: >
            The timeout value in seconds for task assignment. After this time,
            the task will be reassigned

            to another agent.
          type: integer
        workflow_friendly_name:
          description: A human-readable name for the workflow.
          type: string
        workflow_sid:
          description: The SID of the workflow this task is associated with.
          type: string
        workspace_sid:
          description: The SID of the workspace this task belongs to.
          type: string
      type: object
    VersionStatus:
      enum:
        - draft
        - active
        - deprecated
      type: string
    WorkflowStepType:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - additionalProperties: false
          properties:
            companyId:
              description: The company identifier.
              readOnly: true
              type: string
            createdBy:
              description: User identifier who created the workflow step type.
              readOnly: true
              type: string
            decisionQuestion:
              description: >
                Decision question is what leads to the "accepted" or "rejected"
                outcome

                of the step. This question is displayed to an agent next to the
                outcome

                of the step. The questions can lead to accept/reject or to
                yes/no answers.
              type: string
            decisionQuestionType:
              $ref: '#/components/schemas/DecisionQuestionType'
            descriptionLong:
              description: >
                Additional details on how to complete the step. Normally
                displayed

                to an agent when clicked on "more info" or "?" or "i" icons.
              nullable: true
              type: string
            descriptionShort:
              description: |
                A short description of the step. Displayed to agents in the UI.
                Can be a sentence.
              type: string
            mandatory:
              type: boolean
            refId:
              description: The globally unique identifier of the workflow step type.
              format: uuid
              type: string
            updatedBy:
              description: User identifier who last updated the workflow step type.
              readOnly: true
              type: string
            version:
              description: Version of the workflow step type.
              type: integer
            versionStatus:
              $ref: '#/components/schemas/VersionStatus'
            visibility:
              $ref: '#/components/schemas/StepVisibility'
            workItems:
              description: |
                List of work item types that comprise this workflow step type.
              items:
                description: Work item type ID.
                type: string
              type: array
          type: object
    WorkflowType:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - additionalProperties: false
          properties:
            approvalConditions:
              $ref: '#/components/schemas/CaseApprovalConditions'
            companyId:
              description: The company identifier.
              readOnly: true
              type: string
            createdBy:
              description: User identifier who created the workflow type.
              readOnly: true
              type: string
            description:
              description: Description of the workflow type. Used internally.
              type: string
            name:
              description: >
                A short name of workflow. For example: bankruptcy or identity
                theft.
              type: string
            refId:
              description: The globally unique identifier of the workflow type.
              format: uuid
              type: string
            steps:
              description: |
                List of step types that comprise a workflow of this type.
              items:
                description: Step type ID.
                type: string
              type: array
            updatedBy:
              description: User identifier who last updated the workflow type.
              readOnly: true
              type: string
            version:
              description: Version of the workflow type.
              type: integer
            versionStatus:
              $ref: '#/components/schemas/VersionStatus'
          type: object
    WorkflowWorkitemType:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - additionalProperties: false
          properties:
            companyId:
              description: The company identifier.
              readOnly: true
              type: string
            createdBy:
              description: User identifier who created the workflow item type.
              readOnly: true
              type: string
            descriptionLong:
              description: |
                Additional information required to complete the work item.
              nullable: true
              type: string
            descriptionShort:
              description: >
                A short description of the work item. Displayed to agents in the
                UI.

                Can be a sentence.
              type: string
            refId:
              description: The globally unique identifier of the workflow workitem type.
              format: uuid
              type: string
            updatedBy:
              description: User identifier who last updated the workflow item type.
              readOnly: true
              type: string
            version:
              description: Version of the work item type.
              type: integer
            versionStatus:
              $ref: '#/components/schemas/VersionStatus'
          type: object
    Code:
      allOf:
        - $ref: '#/components/schemas/VersionedMixin'
        - properties:
            code:
              description: Base64 of the compiled binary code
              nullable: true
              readOnly: true
              type: string
            codeText:
              description: The source code to compile
              type: string
            compilationVersion:
              description: The compile version
              maxLength: 20
              nullable: true
              readOnly: true
              type: string
            lastCompiledAt:
              description: Timestamp of last compile
              format: date-time
              nullable: true
              readOnly: true
              type: string
            name:
              description: The name of the code
              type: string
          type: object
      title: code
    CodePaging:
      allOf:
        - $ref: '#/components/schemas/Paging'
        - properties:
            data:
              items:
                $ref: '#/components/schemas/Code'
              type: array
          type: object
      title: code
    CodeExecution:
      description: >
        Execution of code requires that all arguments to the function be
        submitted as key-value pairs.

        Running compiled code will produce a single value output.
      properties:
        parameters:
          type: object
          writeOnly: true
        result:
          readOnly: true
      type: object
    DoNotInteractChannel:
      description: >
        Channel(s) for which outbound interactions with a borrower are blocked.
        Use value `all`

        for all channels. At least one of the attributes, `channel` or `theme`,

        must be provided.
      enum:
        - all
        - voice
        - email
        - fax
        - text
        - chat
        - mail
      type: string
    onCondition:
      description: >
        Array of conditions for case fields values. `and` operator is used if
        multiple conditions

        are provided. For example:

        - A `bankruptcy` case has two fields, `chapter` and `dispositionCode`.

        - If two conditions are created: first `chapter=chapter17`, second
        `dispositionCode=dismissed`.

        - The logical condition will look like: `chapter=chapter17` **and**
        `dispositionCode=dismissed`.
      items:
        properties:
          dataType:
            $ref: '#/components/schemas/DataType'
          fieldName:
            $ref: '#/components/schemas/FieldName'
          operator:
            default: eq
            description: >
              The value of the case `fieldName` is compared to `value` using
              this logical operator.

              For example, bankruptcy case `fieldName=chapter` can be compared
              with `value=dismissed` using `eq` (equal operator).


              `eq`=equal, `gt`=greater than, `ge`=greater or equal, `lt`=less
              than, `le`=less or equal, `ne`=not equal.
            enum:
              - eq
              - gt
              - ge
              - lt
              - le
              - ne
            type: string
          value:
            description: |
              The value to compare with.
        type: object
      nullable: true
      type: array
    DoNotInteractTheme:
      description: >
        Theme(s) for which outbound interactions with a borrower are blocked.
        Use value

        `all` for all themes. `all` doesn't include `opsAccountCredentials`.

        For example, use `opsCollDebt` to stop debt collection interactions.

        At least one of the attributes, `channel` or `theme`, must be provided.
      enum:
        - all
        - opsCollDebt
        - opsCollLocateBorrower
        - opsCollVerifyEmployment
        - opsCollContactEmployerNotice
        - opsServicingDebtValidation
        - opsServicingNegativeCreditReportNotice
        - opsServicingTimeBarredNotice
        - opsServicing
      type: string
    DoNotInteractType:
      allOf:
        - $ref: '#/components/schemas/VersionedMixin'
        - properties:
            channel:
              $ref: '#/components/schemas/DoNotInteractChannel'
              description: >
                Channel(s) for which outbound interactions with a borrower are
                blocked.

                Use value `all` for all channels.
            duration:
              default: 0
              description: |
                Number of days during which the interactions will be blocked.
                We start counting from the day conditions are met.
              minimum: 0
              nullable: true
              type: integer
            object:
              default: doNotInteractType
              enum:
                - doNotInteractType
              readOnly: true
              type: string
            onCondition:
              $ref: '#/components/schemas/onCondition'
            onOutcome:
              $ref: '#/components/schemas/ProcessOutcome'
            onStatus:
              $ref: '#/components/schemas/ProcessStatus'
            theme:
              $ref: '#/components/schemas/DoNotInteractTheme'
              description: >
                Theme(s) for which outbound interactions with a borrower are
                blocked. Use value

                `all` for all themes. `all` doesn't include
                `opsAccountCredentials`.

                For example, use `opsCollDebt` to stop debt collection
                interactions.
            unit:
              description: Indicates how to count days provided in `duration`.
              enum:
                - calendarDays
                - businessDays
              nullable: true
              type: string
          type: object
      title: doNotInteractHandler
    DocumentStatus:
      description: >
        The document status. The status can be displayed in UI.


        `draft` - the document was rendered or created but has not accepted or
        rejected yet.


        `accepted` - the document was determined to be valid and was accepted.


        `rejected` - the document was determined to be invalid and was rejected.
      enum:
        - draft
        - accepted
        - rejected
      type: string
    DocumentDescriptorFields:
      properties:
        archived:
          default: false
          description: |
            Set to `true` if the document has been archived.
          type: boolean
        autogenerated:
          description: >
            `true` if this document is generated automatically by a Peach
            system, `false` if this

            document is created and uploaded manually by a human. If left blank
            then this value is

            guessed from the document type.
          nullable: true
          type: boolean
        contentId:
          description: >-
            The document content identifier. Use this identifier to get the
            document content.
          format: uuid
          readOnly: true
          type: string
        contentLength:
          description: The document content length in bytes.
          minimum: 0
          readOnly: true
          type: integer
        contentType:
          description: The document content type. For example, PDF or JPEG.
          readOnly: true
          type: string
        conversionSourceId:
          description: >-
            The original document identifier that was used as a source for
            conversion to a specific format.
          readOnly: true
          type: string
        description:
          description: The description for the document. Normally displayed in UI.
          type: string
        evidenceId:
          description: >
            The evidence document identifier. For example: when a borrower
            enables Autopay, the evidence

            document will be the snapshot of UI page.
          nullable: true
          type: string
        fileName:
          description: >
            The file name of the document. If the document is rendered from a
            template by the Peach system,

            the file name will be generated automatically.

            If the document is created from a file, it will be the name of the
            file that was uploaded.

            Normally displayed in UI.
          type: string
        isHumanBorrowerUpload:
          description: >
            `true` if this document was uploaded by a human borrower--meaning
            that a borrower (or

            their representative) used a browser to upload this document
            directly. To put this

            another way, this document was *not* uploaded by an agent and was
            *not* uploaded by any

            automated system.
          readOnly: true
          type: boolean
        loanId:
          description: The loan identifier that the documents belongs to.
          nullable: true
          type: string
        metaData:
          $ref: '#/components/schemas/MetaData'
        personId:
          description: The borrower's identifier that the documents belongs to.
          readOnly: true
          type: string
        rejectionReason:
          description: >-
            The reason why the document was rejected. This is a free text.
            Normally displayed in UI.
          type: string
        sensitiveData:
          description: >
            Set this flag to `true` if this document has sensitive information,
            such as PII. The flag is used for

            proper authorization of access to the information.
          type: boolean
        status:
          $ref: '#/components/schemas/DocumentStatus'
        templateVersionId:
          description: >-
            Peach internal template identifier that was used to render the
            document.
          nullable: true
          type: string
        updatedBy:
          $ref: '#/components/schemas/UserActionInfo'
          description: |
            Details of the user who last updated the document.
            Can be an borrower, agent, or automated system process.
        uploadedAt:
          format: date-time
          nullable: true
          readOnly: true
          type: string
        uploadedBy:
          $ref: '#/components/schemas/UserActionInfo'
          description: |
            Details of the user responsible for uploading the document.
            Can be an borrower, agent, or automated system process.
        verifiedAt:
          format: date-time
          nullable: true
          readOnly: true
          type: string
        verifiedBy:
          $ref: '#/components/schemas/UserActionInfo'
          description: |
            Details of the user responsible for verifing the document.
            Can be an agent or automated system process.
      type: object
    DocumentType:
      description: The document type.
      enum:
        - loanTermsAgreementOnly
        - loanTILDisclosureOnly
        - loanTermsAndTILCombined
        - loanTermsChangeAgreement
        - loanAutopayAgreement
        - loanStatement
        - loanSettlementAgreement
        - privacyPolicyLender
        - privacyPolicyServicer
        - termsOfServiceLender
        - termsOfServiceServicer
        - caseDocument
        - disclosure
        - evidence
        - otherStatement
        - other
      type: string
    DocumentDescriptorCreate:
      allOf:
        - $ref: '#/components/schemas/BaseWithExternalIdMixin'
        - $ref: '#/components/schemas/DocumentDescriptorFields'
        - properties:
            type:
              $ref: '#/components/schemas/DocumentType'
          required:
            - type
          type: object
    DocumentDescriptorResponse:
      allOf:
        - $ref: '#/components/schemas/BaseWithExternalIdMixin'
        - $ref: '#/components/schemas/DocumentDescriptorFields'
        - properties:
            type:
              $ref: '#/components/schemas/DocumentType'
          type: object
    EmployeeBase:
      properties:
        firstName:
          description: The employee's first name.
          maxLength: 50
          minLength: 1
          type: string
        lastName:
          description: The employee's last name.
          maxLength: 50
          minLength: 1
          type: string
      type: object
    Team:
      description: A team is a named grouping of Employees
      properties:
        email:
          description: The group email (or listserve) associated with this team.
          nullable: true
          type: string
        employeeCount:
          description: The number of employees on this team.
          readOnly: true
          type: integer
        externalId:
          description: The lender's external identifier of the team.
          nullable: true
          type: string
        id:
          readOnly: true
          type: string
        name:
          description: >-
            The name of the team—e.g., "Engineering", "Operations", "Customer
            Support". Must be unique.
          minLength: 1
          type: string
      type: object
    Employee:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - $ref: '#/components/schemas/EmployeeBase'
        - description: An employee in the company
          properties:
            assignedInvestorIds:
              description: >
                The unique identifiers of the investors assigned to the
                employee.
              items:
                $ref: '#/components/schemas/AnyId'
              readOnly: true
              type: array
            availableAndPermittedTasktypes:
              $ref: '#/components/schemas/TaskType'
            companyId:
              description: The unique company identifier.
              readOnly: true
              type: string
            displayName:
              description: |
                The agent's first and last name, if set. Otherwise, their email
                address.
              nullable: true
              readOnly: true
              type: string
            email:
              description: The employee's email address.
              maxLength: 100
              minLength: 1
              nullable: true
              type: string
            externalId:
              description: The lender's external identifier for the employee.
              nullable: true
              type: string
            id:
              description: A unique identifier for the employee
              readOnly: true
              type: string
            jobName:
              description: >-
                The name of position in the company—e.g., "CEO", "Agent",
                "Supervisor"
              maxLength: 100
              minLength: 1
              nullable: true
              type: string
            managerEmployeeId:
              $ref: '#/components/schemas/AnyId'
              description: The ID of the employee's manager
              nullable: true
            object:
              default: Employee
              enum:
                - Employee
              readOnly: true
              type: string
            phone:
              description: The employee's phone number.
              maxLength: 16
              minLength: 1
              nullable: true
              type: string
            teams:
              items:
                $ref: '#/components/schemas/Team'
              type: array
            user:
              allOf:
                - $ref: '#/components/schemas/UserBasic'
                - readOnly: true
              description: The user associated with this employee
            userId:
              description: The ID of the user associated with this employee
              type: string
              writeOnly: true
          type: object
    EmailSignatureUpdate:
      description: An email signature for an employee
      properties:
        contentHtml:
          description: The HTML email signature content
          maxLength: 10000
          minLength: 0
          nullable: true
          type: string
        enabled:
          description: >
            Whether the email signature is enabled. If true, new emails should
            include the signature

            when drafted.
          nullable: false
          type: boolean
      type: object
    EmailSignature:
      allOf:
        - $ref: '#/components/schemas/EmailSignatureUpdate'
        - description: An email signature for an employee
          properties:
            contentText:
              description: >
                The plain text version of the email signature content. This is
                generated from the `contentHtml` field

                and cannot be set.
              nullable: false
              readOnly: true
              type: string
            employeeId:
              description: The ID of the employee associated with this email signature.
              readOnly: true
              type: string
            lastUpdatedAt:
              description: The last time the email signature was updated.
              format: date-time
              nullable: true
              readOnly: true
              type: string
          type: object
    personId:
      description: A Borrower's unique identifier.
      type: string
    readOnlyExternalId:
      nullable: true
      readOnly: true
      type: string
    loanId:
      description: Loan's unique identifier.
      type: string
    BaseEvent:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            companyId:
              description: Company's unique identifier.
              type: string
            creatingMessageId:
              description: The message ID responsible for creating this event.
              type: string
            discriminator:
              description: String indicating the type of the parent object.
              type: string
            effectiveAt:
              description: >-
                The date and time at which the event was effective. This may
                differ from the date of creation.
              format: date-time
              type: string
            id:
              description: Event's unique identifier.
              type: string
            parentId:
              description: Unique identifier of the parent object for the event.
              type: string
          type: object
    LoanEvent:
      allOf:
        - properties:
            borrowerId:
              $ref: '#/components/schemas/personId'
            loanExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
            loanId:
              $ref: '#/components/schemas/loanId'
            personExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
          type: object
        - $ref: '#/components/schemas/BaseEvent'
    condition:
      enum:
        - balanceNA
        - balanceBroken
        - balanceRed
        - balanceYellow
        - balanceGreen
      type: string
    periodId:
      description: Period's unique identifier.
      type: string
    AutopayPaymentRescheduledEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            condition:
              $ref: '#/components/schemas/condition'
            eventType:
              enum:
                - autopay.payment.rescheduled
              type: string
            periodId:
              $ref: '#/components/schemas/periodId'
          type: object
      title: autopay.payment.rescheduled
    AutopayPaymentCanceledEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            condition:
              $ref: '#/components/schemas/condition'
            eventType:
              enum:
                - autopay.payment.canceled
              type: string
            periodId:
              $ref: '#/components/schemas/periodId'
          type: object
      title: autopay.payment.canceled
    autopayCancellationReason:
      enum:
        - invalidPaymentMethod
        - paymentMethodRemoved
        - tooManyFailedAttempts
        - loanFrozen
        - loanAccelerated
        - loanChargedOff
        - loanPaidOff
        - canceledByUser
        - loanTermsChanged
      type: string
    CancelAutopayScheduleEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            cancellationReason:
              $ref: '#/components/schemas/autopayCancellationReason'
            eventType:
              enum:
                - autopay.schedule.cancel
              type: string
          type: object
      title: autopay.schedule.cancel
    AutopayScheduleChangedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - autopay.schedule.changed
              type: string
          type: object
      title: autopay.schedule.changed
    cardId:
      description: Card's unique identifier.
      type: string
    CardReplacementRequestedEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            cardId:
              $ref: '#/components/schemas/cardId'
            eventType:
              enum:
                - card.replacement.requested
              type: string
            loanId:
              $ref: '#/components/schemas/loanId'
          type: object
      title: card.replacement.requested
    CardCreatedEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            cardId:
              $ref: '#/components/schemas/cardId'
            eventType:
              enum:
                - card.created
              type: string
            loanId:
              $ref: '#/components/schemas/loanId'
          type: object
      title: card.created
    cardStatus:
      description: The status of the card.
      enum:
        - inactive
        - pendingActivation
        - pendingFulfillment
        - active
        - paused
        - suspended
        - terminated
        - canceled
        - expired
        - invalid
      type: string
    cardStatusChangeReasonCode:
      enum:
        - cardCanceled
        - cardExpired
        - cardInvalid
        - cardClosed
        - cardDamaged
        - cardFraudulent
        - cardInactive
        - cardLost
        - cardPFraud
        - cardSuspended
        - cardUnauthorized
        - cardAcceptorActivityQuestionable
        - cardStolen
      type: string
    CardStatusChangedEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            cardId:
              $ref: '#/components/schemas/cardId'
            eventType:
              enum:
                - card.status.changed
              type: string
            loanId:
              $ref: '#/components/schemas/loanId'
            newStatus:
              $ref: '#/components/schemas/cardStatus'
            oldStatus:
              $ref: '#/components/schemas/cardStatus'
            statusChangeReasonCode:
              $ref: '#/components/schemas/cardStatusChangeReasonCode'
          type: object
      title: card.status.changed
    caseId:
      description: Case's unique identifier.
      type: string
    CaseEvent:
      allOf:
        - properties:
            borrowerId:
              $ref: '#/components/schemas/personId'
            caseExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
            caseId:
              $ref: '#/components/schemas/caseId'
            personExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
          type: object
        - $ref: '#/components/schemas/BaseEvent'
    associatedId:
      description: Associated object's unique identifier.
      type: string
    associatedObject:
      description: Associated object type.
      type: string
    CaseAssociationAddedEvent:
      allOf:
        - $ref: '#/components/schemas/CaseEvent'
        - properties:
            associatedId:
              $ref: '#/components/schemas/associatedId'
            associatedObject:
              $ref: '#/components/schemas/associatedObject'
            eventType:
              enum:
                - case.association.added
              type: string
          type: object
      title: case.association.added
    CaseAssociationRemovedEvent:
      allOf:
        - $ref: '#/components/schemas/CaseEvent'
        - properties:
            associatedId:
              $ref: '#/components/schemas/associatedId'
            associatedObject:
              $ref: '#/components/schemas/associatedObject'
            eventType:
              enum:
                - case.association.removed
              type: string
          type: object
      title: case.association.removed
    CaseDoNotInteractCreatedEvent:
      allOf:
        - $ref: '#/components/schemas/CaseEvent'
        - properties:
            eventType:
              enum:
                - case.donotinteract.created
              type: string
          type: object
      title: case.donotinteract.created
    CaseDoNotInteractDeletedEvent:
      allOf:
        - $ref: '#/components/schemas/CaseEvent'
        - properties:
            eventType:
              enum:
                - case.donotinteract.deleted
              type: string
          type: object
      title: case.donotinteract.deleted
    CaseDoNotInteractUpdatedEvent:
      allOf:
        - $ref: '#/components/schemas/CaseEvent'
        - properties:
            eventType:
              enum:
                - case.donotinteract.updated
              type: string
          type: object
      title: case.donotinteract.updated
    JSONPatchOpAddReplaceTest:
      properties:
        op:
          enum:
            - add
            - replace
            - test
          type: string
        value: {}
      required:
        - op
        - value
      type: object
    JSONPatchOpMoveCopy:
      properties:
        from:
          type: string
        op:
          enum:
            - move
            - copy
          type: string
      required:
        - op
        - from
      type: object
    JSONPatchOpRemove:
      properties:
        op:
          enum:
            - remove
          type: string
      required:
        - op
      type: object
    JSONPatchOp:
      allOf:
        - properties:
            path:
              type: string
          required:
            - path
          type: object
        - anyOf:
            - $ref: '#/components/schemas/JSONPatchOpAddReplaceTest'
            - $ref: '#/components/schemas/JSONPatchOpMoveCopy'
            - $ref: '#/components/schemas/JSONPatchOpRemove'
    ChangeEvent:
      allOf:
        - properties:
            changeType:
              enum:
                - create
                - update
                - delete
              type: string
            jsonPatch:
              items:
                $ref: '#/components/schemas/JSONPatchOp'
              type: array
          type: object
        - $ref: '#/components/schemas/BaseEvent'
    CaseDoNotInteractChangedEvent:
      allOf:
        - properties:
            caseId:
              $ref: '#/components/schemas/caseId'
            doNotInteractId:
              description: DNI's unique identifier
              type: string
            eventType:
              enum:
                - case.donotinteract.changed
              type: string
          type: object
        - $ref: '#/components/schemas/ChangeEvent'
      title: case.donotinteract.changed
    CaseDoNotInteractExpiredEvent:
      allOf:
        - properties:
            eventType:
              enum:
                - case.donotinteract.expired
              type: string
          type: object
        - $ref: '#/components/schemas/CaseEvent'
      title: case.donotinteract.expired
    CaseEscalationChangedEvent:
      allOf:
        - properties:
            caseId:
              $ref: '#/components/schemas/caseId'
            escalationId:
              description: Escalation's unique identifier
              type: string
            eventType:
              enum:
                - case.escalation.changed
              type: string
          type: object
        - $ref: '#/components/schemas/ChangeEvent'
      title: case.escalation.changed
    CaseCreatedEvent:
      allOf:
        - $ref: '#/components/schemas/CaseEvent'
        - properties:
            eventType:
              enum:
                - case.created
              type: string
          type: object
      description: >
        *** DEPRECATED ***

        This event is being replaced by `case.changed` with a `changeType` of
        `create`. `case.created` will still appear in API

        responses for historical events, but new events will use `case.changed`.
      title: case.created
    CaseUpdatedEvent:
      allOf:
        - $ref: '#/components/schemas/CaseEvent'
        - properties:
            eventType:
              enum:
                - case.updated
              type: string
          type: object
      description: >
        *** DEPRECATED ***

        This event is being replaced by `case.changed` with a `changeType` of
        `update`. `case.updated` will still appear in API

        responses for historical events, but new events will use `case.changed`.
      title: case.updated
    CaseDeletedEvent:
      allOf:
        - $ref: '#/components/schemas/CaseEvent'
        - properties:
            eventType:
              enum:
                - case.deleted
              type: string
          type: object
      description: |
        *** DEPRECATED ***
        This event was never used and will not appear in API requests.
      title: case.deleted
    CaseChangedEvent:
      allOf:
        - properties:
            borrowerId:
              allOf:
                - $ref: '#/components/schemas/personId'
              description: >
                The borrower (person) associated with the case. Present on every
                change type when the case has an associated person; omitted
                otherwise.
            caseId:
              $ref: '#/components/schemas/caseId'
            eventType:
              enum:
                - case.changed
              type: string
          type: object
        - $ref: '#/components/schemas/ChangeEvent'
      title: case.changed
    TemplateDescriptorChangedEvent:
      allOf:
        - properties:
            eventType:
              enum:
                - template.descriptor.changed
              type: string
            templateDescriptorId:
              type: string
            userEmail:
              description: >-
                Email of the acting user, snapshotted at event creation time
                (point-in-time); omitted when unavailable.
              nullable: true
              type: string
            userId:
              description: Public id of the user who made the change.
              type: string
            userName:
              description: >-
                Display name of the acting user, snapshotted onto the event at
                creation time (point-in-time; not re-resolved from userId).
              nullable: true
              type: string
          type: object
        - $ref: '#/components/schemas/ChangeEvent'
      title: template.descriptor.changed
    TemplateVersionChangedEvent:
      allOf:
        - properties:
            eventType:
              enum:
                - template.version.changed
              type: string
            templateDescriptorId:
              type: string
            templateVersionId:
              type: string
            userEmail:
              description: >-
                Email of the acting user, snapshotted at event creation time
                (point-in-time); omitted when unavailable.
              nullable: true
              type: string
            userId:
              description: Public id of the user who made the change.
              type: string
            userName:
              description: >-
                Display name of the acting user, snapshotted onto the event at
                creation time (point-in-time; not re-resolved from userId).
              nullable: true
              type: string
          type: object
        - $ref: '#/components/schemas/ChangeEvent'
      title: template.version.changed
    TemplateVersionActivatedEvent:
      allOf:
        - properties:
            eventType:
              enum:
                - template.version.activated
              type: string
            previousVersionId:
              nullable: true
              type: string
            templateDescriptorId:
              type: string
            templateVersionId:
              type: string
            userEmail:
              description: >-
                Email of the acting user, snapshotted at event creation time
                (point-in-time); omitted when unavailable.
              nullable: true
              type: string
            userId:
              description: Public id of the user who made the change.
              type: string
            userName:
              description: >-
                Display name of the acting user, snapshotted onto the event at
                creation time (point-in-time; not re-resolved from userId).
              nullable: true
              type: string
          type: object
        - $ref: '#/components/schemas/BaseEvent'
      title: template.version.activated
    contactId:
      description: Contact's unique identifier.
      type: string
    ContactEvent:
      allOf:
        - properties:
            borrowerId:
              $ref: '#/components/schemas/personId'
            contactExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
            contactId:
              $ref: '#/components/schemas/contactId'
            personExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
          type: object
        - $ref: '#/components/schemas/BaseEvent'
    ContactCreatedEvent:
      allOf:
        - $ref: '#/components/schemas/ContactEvent'
        - properties:
            eventType:
              enum:
                - contact.created
              type: string
          type: object
      title: contact.created
    ContactUpdatedEvent:
      allOf:
        - $ref: '#/components/schemas/ContactEvent'
        - properties:
            eventType:
              enum:
                - contact.updated
              type: string
          type: object
      title: contact.updated
    ContactDeletedEvent:
      allOf:
        - $ref: '#/components/schemas/ContactEvent'
        - properties:
            eventType:
              enum:
                - contact.deleted
              type: string
          type: object
      title: contact.deleted
    InteractionBlockedEvent:
      allOf:
        - $ref: '#/components/schemas/CaseEvent'
        - properties:
            contactExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
            contactId:
              $ref: '#/components/schemas/contactId'
            eventType:
              enum:
                - interaction.blocked
              type: string
          type: object
      description: |
        *** DEPRECATED ***
        This event was never used and will not appear in API requests.
      title: interaction.blocked
    CloseReason:
      description: >
        The description of the reason why the account was closed. If passed,

        the `closeReason` value will be used in the `locLineClosed`
        communication template.

        Make sure to phrase the copy as a full sentence or paragraph.
      type: string
    CloseReasonDetails:
      default: other
      description: |
        The reason why the account was closed.
        The reasons:
          - `requestedByBorrower` - a borrower requested to close the account.
          - `inactivity` - the account was closed by lender due to inactivity.
          - `terms` - the account was closed by lender because it was created with wrong terms or terms changed later (e.g. re-underwriting, charge off, bankruptcy).
          - `technicalIssue` - the account was closed by lender due to a technical issue.
          - `fraud` - the account was closed by lender due to fraud.
          - `other` - the account was closed by lender due to a reason not listed above.
      enum:
        - requestedByBorrower
        - inactivity
        - terms
        - technicalIssue
        - fraud
        - other
      type: string
    CloseRequestedByBorrower:
      description: >
        Set to true if a borrower requested to close the account.

        Note: This attribute has been deprecated, and you should use
        `closeReasonDetails` instead.
          - If you pass both `closeRequestedByBorrower` and `closeReasonDetails`, the system will ignore the `closeRequestedByBorrower` attribute.
          - If you pass `closeRequestedByBorrower` but not `closeReasonDetails`, the system will set `closeReasonDetails=requestedByBorrower`.
      nullable: true
      type: boolean
    LoanCloseSendNotice:
      default: true
      description: >
        When set to `true`, the system will send a `locLineClosed` notice to the
        borrower.
      type: boolean
    LoanClosedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            caseId:
              $ref: '#/components/schemas/caseId'
            closeReason:
              $ref: '#/components/schemas/CloseReason'
            closeReasonDetails:
              $ref: '#/components/schemas/CloseReasonDetails'
            closeRequestedByBorrower:
              $ref: '#/components/schemas/CloseRequestedByBorrower'
            eventType:
              enum:
                - loan.closed
              type: string
            sendNotice:
              $ref: '#/components/schemas/LoanCloseSendNotice'
          type: object
      title: loan.closed
    LoanCreatedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.created
              type: string
          type: object
      title: loan.created
    CaseId:
      properties:
        caseId:
          description: An identifier for an existing case.
          type: string
      type: object
    LoanCreditLimitChangedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            adverseActionReason:
              description: The reason why the credit limit was changed.
              type: string
            creditLimitAmount:
              description: The new credit limit amount.
              type: number
            eventType:
              enum:
                - loan.credit.limit.changed
              type: string
            sendNotice:
              description: Whether a notice was sent to the borrower
              type: boolean
          type: object
        - $ref: '#/components/schemas/CaseId'
      title: loan.credit.limit.changed
    DrawCreditLimitChangedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            creditLimitAmount:
              description: The new credit limit amount.
              type: number
            creditLimitPercentage:
              description: >-
                The draw's credit limit as a percentage of the loan's credit
                limit
              type: number
            eventType:
              enum:
                - draw.credit.limit.changed
              type: string
          type: object
        - $ref: '#/components/schemas/CaseId'
      title: draw.credit.limit.changed
    LoanCurrentEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.current
              type: string
            statusChangedDate:
              format: date
              type: string
          type: object
      title: loan.current
    LoanFeeCapitalizedEvent:
      properties:
        borrowerId:
          $ref: '#/components/schemas/personId'
        eventType:
          enum:
            - loan.fee.capitalized
          type: string
        expectedPaymentId:
          $ref: '#/components/schemas/AnyId'
        feeTypeId:
          $ref: '#/components/schemas/AnyId'
        loanFeeId:
          $ref: '#/components/schemas/AnyId'
        loanId:
          $ref: '#/components/schemas/loanId'
      title: loan.fee.capitalized
      type: object
    LoanOverdueEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.overdue
              type: string
            overdueNumberDays:
              type: number
            overdueTotalAmount:
              format: float
              type: number
            statusChangedDate:
              format: date
              type: string
          type: object
      title: loan.overdue
    LoanOverdueUpdateEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.overdue.update
              type: string
            overdueNumberDays:
              type: number
            overdueTotalAmount:
              format: float
              type: number
            statusChangedDate:
              format: date
              type: string
          type: object
      title: loan.overdue.update
    LoanLateFeeBookedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.latefee.booked
              type: string
            expectedPaymentId:
              $ref: '#/components/schemas/AnyId'
          type: object
      title: loan.latefee.booked
    LoanMigrationSucceededEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.migration.succeeded
              type: string
            migrationEventCreatingMessageId:
              type: string
          type: object
      title: loan.migration.succeeded
    LoanMigrationFailedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.migration.failed
              type: string
            migrationEventCreatingMessageId:
              type: string
          type: object
      title: loan.migration.failed
    LoanModificationFeeBookedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.modificationfee.booked
              type: string
            expectedPaymentId:
              $ref: '#/components/schemas/AnyId'
          type: object
      title: loan.modificationfee.booked
    LoanFeeBooked:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.fee.booked
              type: string
            expectedPaymentId:
              $ref: '#/components/schemas/AnyId'
            feeType:
              enum:
                - foreignTransactionFee
                - lateFee
                - modificationFee
                - purchaseFee
                - nsfFee
                - serviceFee
              type: string
          type: object
      title: loan.fee.booked
    LoanFeeCanceledEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            caseId:
              $ref: '#/components/schemas/CaseId'
            eventType:
              enum:
                - loan.fee.canceled
              type: string
            expectedPaymentId:
              $ref: '#/components/schemas/AnyId'
            feeChargedAt:
              format: date-time
              type: string
            feeTypeId:
              $ref: '#/components/schemas/AnyId'
            loanFeeId:
              $ref: '#/components/schemas/AnyId'
            lockId:
              nullable: true
              type: string
          type: object
      title: loan.fee.canceled
    LoanFeeChangedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            caseId:
              $ref: '#/components/schemas/CaseId'
            eventType:
              enum:
                - loan.fee.changed
              type: string
            expectedBalanceImpact:
              enum:
                - increase
                - decrease
                - unknown
              type: string
            expectedPaymentId:
              $ref: '#/components/schemas/AnyId'
            feeChargedAt:
              format: date-time
              type: string
            feeTypeId:
              $ref: '#/components/schemas/AnyId'
            loanFeeId:
              $ref: '#/components/schemas/AnyId'
            lockId:
              nullable: true
              type: string
            newAmount:
              nullable: true
              type: number
            oldAmount:
              type: number
          type: object
      title: loan.fee.changed
    LoanOwnerChangedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.ownerchanged
              type: string
          type: object
      title: loan.ownerchanged
    drawId:
      description: Draw's unique identifier.
      type: string
    RemainingBalancesDeferredEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            deferralType:
              enum:
                - capitalizeRemainingBalance
              nullable: false
              type: string
            drawIds:
              items:
                $ref: '#/components/schemas/drawId'
              type: array
            dueDates:
              items:
                format: date
                type: string
              type: array
            eventType:
              enum:
                - loan.remainingbalances.deferred
              type: string
            totalDeferredAmount:
              format: float
              type: number
          type: object
      title: loan.remainingbalances.deferred
    LoanPromoProgramActivatedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.promoprogram.activated
              type: string
            promoId:
              $ref: '#/components/schemas/AnyId'
          type: object
      title: loan.promoprogram.activated
    LoanPromoProgramCanceledEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.promoprogram.canceled
              type: string
            promoId:
              $ref: '#/components/schemas/AnyId'
          type: object
      title: loan.promoprogram.canceled
    LoanPromoProgramCreatedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.promoprogram.created
              type: string
            promoId:
              $ref: '#/components/schemas/AnyId'
          type: object
      title: loan.promoprogram.created
    LoanPromoProgramExercisedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.promoprogram.exercised
              type: string
            promoId:
              $ref: '#/components/schemas/AnyId'
          type: object
      title: loan.promoprogram.exercised
    LoanPromoProgramReactivatedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.promoprogram.reactivated
              type: string
            promoId:
              $ref: '#/components/schemas/AnyId'
          type: object
      title: loan.promoprogram.reactivated
    LoanPromoProgramUpdatedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.promoprogram.updated
              type: string
            promoId:
              $ref: '#/components/schemas/AnyId'
          type: object
      title: loan.promoprogram.updated
    LoanRateCreatedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.rate.created
              type: string
          type: object
      title: loan.rate.created
    LoanRateUpdatedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.rate.updated
              type: string
          type: object
      title: loan.rate.updated
    LoanRefundedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.refunded
              type: string
          type: object
      title: loan.refunded
    LoanReimbursementInitiatedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.reimbursement.initiated
              type: string
          type: object
      title: loan.reimbursement.initiated
    LoanReimbursementProcessedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.reimbursement.processed
              type: string
          type: object
      title: loan.reimbursement.processed
    LoanStatusChangedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.statuschanged
              type: string
            newStatus:
              $ref: '#/components/schemas/LoanStatus'
            oldStatus:
              $ref: '#/components/schemas/LoanStatus'
          type: object
      title: loan.statuschanged
    PeriodStartedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            dueDate:
              description: The due date associated with the period.
              format: date-time
              type: string
            eventType:
              enum:
                - loan.period.started
              type: string
            periodId:
              $ref: '#/components/schemas/periodId'
          required:
            - dueDate
          type: object
      title: loan.period.started
    ObligationStatusChangedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            eventType:
              enum:
                - loan.obligation.statuschanged
              type: string
            isOverdue:
              description: |
                The new obligation status to be recorded
              type: boolean
          required:
            - isOverdue
          type: object
      title: loan.obligation.statuschanged
    previousInteractionId:
      description: >-
        If a previous interaction identifier is provided, the current and
        previous interactions will be linked. This can either be Peach's or a
        lender's external identifier.
      nullable: true
      type: string
    supercaseBulkOperationId:
      description: If a `SupercaseBulkOperation` created this event, this is that ID
      nullable: true
      type: string
    SendCommunicationEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            attachments:
              description: |
                An optional list of documents to attach to the outgoing email.
              items:
                description: A document descriptor ID.
                type: string
              type: array
            caseId:
              $ref: '#/components/schemas/caseId'
            channel:
              $ref: '#/components/schemas/InteractionChannel'
            contactId:
              $ref: '#/components/schemas/contactId'
            context:
              description: >
                Additional context to be passed when creating a message from
                preset templates for communication
              type: object
            eventType:
              enum:
                - communication.send
              type: string
            isTransactional:
              default: true
              type: boolean
            loanId:
              $ref: '#/components/schemas/loanId'
            loanIds:
              items:
                type: string
              type: array
            personId:
              $ref: '#/components/schemas/personId'
            previousInteractionId:
              $ref: '#/components/schemas/previousInteractionId'
            subject:
              $ref: '#/components/schemas/InteractionSubject'
            supercaseBulkOperationId:
              $ref: '#/components/schemas/supercaseBulkOperationId'
            theme:
              $ref: '#/components/schemas/InteractionTheme'
          required:
            - subject
            - personId
          type: object
      title: communication.send
    statementId:
      description: Statement's unique identifier.
      type: string
    StatementCreatedEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            eventType:
              enum:
                - statement.created
              type: string
            loanExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
            loanId:
              $ref: '#/components/schemas/loanId'
            periodId:
              $ref: '#/components/schemas/periodId'
            statementId:
              $ref: '#/components/schemas/statementId'
          type: object
      title: statement.created
    ownerId:
      description: >-
        Payment instrument owner's unique identifier. Currently, the owner can
        be a borrower, investor, broker or payment processor.
      type: string
    ownerType:
      description: Type of owner of the payment instrument.
      enum:
        - person
        - investor
        - broker
        - paymentProcessor
      type: string
    paymentInstrumentId:
      description: Payment Instrument's unique identifier.
      type: string
    PaymentInstrumentCreatedEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            borrowerId:
              $ref: '#/components/schemas/personId'
              nullable: true
            eventType:
              enum:
                - payment.instrument.created
              type: string
            ownerId:
              $ref: '#/components/schemas/ownerId'
            ownerType:
              $ref: '#/components/schemas/ownerType'
            paymentInstrumentExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
            paymentInstrumentId:
              $ref: '#/components/schemas/paymentInstrumentId'
            personExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
          type: object
      title: payment.instrument.created
    PaymentInstrumentUpdatedEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            borrowerId:
              $ref: '#/components/schemas/personId'
              nullable: true
            changes:
              type: object
            eventType:
              enum:
                - payment.instrument.updated
              type: string
            ownerId:
              $ref: '#/components/schemas/ownerId'
            ownerType:
              $ref: '#/components/schemas/ownerType'
            paymentInstrumentId:
              $ref: '#/components/schemas/paymentInstrumentId'
          type: object
      title: payment.instrument.updated
    PaymentInstrumentDeactivatedEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            borrowerId:
              $ref: '#/components/schemas/personId'
              nullable: true
            eventType:
              enum:
                - payment.instrument.deactivated
              type: string
            ownerId:
              $ref: '#/components/schemas/ownerId'
            ownerType:
              $ref: '#/components/schemas/ownerType'
            paymentInstrumentExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
            paymentInstrumentId:
              $ref: '#/components/schemas/paymentInstrumentId'
            personExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
          type: object
      title: payment.instrument.deactivated
    PersonBankruptcyDeceasedStartMonitoringEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            borrowerId:
              $ref: '#/components/schemas/personId'
            eventType:
              enum:
                - person.monitoring.bankruptcy.started
              type: string
            personExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
          type: object
      title: person.monitoring.bankruptcy.started
    consentId:
      description: Consent's unique identifier.
      type: string
    PersonConsentUpdatedEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            borrowerId:
              $ref: '#/components/schemas/personId'
            consentId:
              $ref: '#/components/schemas/consentId'
            eventType:
              enum:
                - person.consent.updated
              type: string
            personExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
          type: object
      title: person.consent.updated
    PersonCreatedEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            borrowerId:
              $ref: '#/components/schemas/personId'
            eventType:
              enum:
                - person.created
              type: string
            personExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
          type: object
      title: person.created
    PersonSCRAStartMonitoringEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            borrowerId:
              $ref: '#/components/schemas/personId'
            eventType:
              enum:
                - person.monitoring.scra.start
              type: string
            personExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
          type: object
      title: person.monitoring.scra.start
    transactionId:
      description: Transaction's unique identifier.
      type: string
    PaymentChargebackEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            amount:
              description: The amount of the chargeback
              type: number
            borrowerId:
              $ref: '#/components/schemas/personId'
            description:
              description: The description of the chargeback
              type: string
            eventType:
              enum:
                - payment.chargeback
              type: string
            loanId:
              $ref: '#/components/schemas/loanId'
            reasonCode:
              description: The reason code
              type: string
            transactionId:
              $ref: '#/components/schemas/transactionId'
          type: object
      title: payment.chargeback
    PaymentChargebackReversedEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            amount:
              description: The amount of the chargeback
              type: number
            borrowerId:
              $ref: '#/components/schemas/personId'
            description:
              description: The description of the chargeback
              type: string
            eventType:
              enum:
                - payment.chargeback.reversed
              type: string
            loanId:
              $ref: '#/components/schemas/loanId'
            reasonCode:
              description: The reason code
              type: string
            transactionId:
              $ref: '#/components/schemas/transactionId'
          type: object
      title: payment.chargeback.reversed
    PaymentFailedEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            eventType:
              enum:
                - payment.failed
              type: string
            transactionExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
            transactionId:
              $ref: '#/components/schemas/transactionId'
          type: object
      title: payment.failed
    PaymentInitiatedEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            borrowerId:
              $ref: '#/components/schemas/personId'
            eventType:
              enum:
                - payment.initiated
              type: string
            personExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
            transactionExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
            transactionId:
              $ref: '#/components/schemas/transactionId'
          type: object
      title: payment.initiated
    PaymentPendingEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            borrowerId:
              $ref: '#/components/schemas/personId'
            eventType:
              enum:
                - payment.pending
              type: string
            personExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
            transactionExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
            transactionId:
              $ref: '#/components/schemas/transactionId'
          type: object
      title: payment.pending
    PaymentReversedEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            amount:
              description: The amount of the reversal
              type: number
            borrowerExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
            borrowerId:
              $ref: '#/components/schemas/personId'
            eventType:
              enum:
                - payment.reversed
              type: string
            reversedAmount:
              description: The sum of all of the reversals of the original transaction.
              type: number
            reversedTransactionId:
              description: Unique identifier of the original transaction.
              type: string
            transactionExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
            transactionId:
              $ref: '#/components/schemas/transactionId'
          type: object
      title: payment.reversed
    PaymentScheduledEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            borrowerId:
              $ref: '#/components/schemas/personId'
            eventType:
              enum:
                - payment.scheduled
              type: string
            personExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
            transactionExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
            transactionId:
              $ref: '#/components/schemas/transactionId'
          type: object
      title: payment.scheduled
    PaymentSucceededEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            borrowerId:
              $ref: '#/components/schemas/personId'
            eventType:
              enum:
                - payment.succeeded
              type: string
            loanId:
              $ref: '#/components/schemas/loanId'
            paymentInstrumentId:
              $ref: '#/components/schemas/paymentInstrumentId'
            transactionExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
            transactionId:
              $ref: '#/components/schemas/transactionId'
          type: object
      title: payment.succeeded
    newScheduledDate:
      format: date
      type: string
    oldScheduledDate:
      format: date
      type: string
    PaymentRescheduledEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            borrowerExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
            borrowerId:
              $ref: '#/components/schemas/personId'
            eventType:
              enum:
                - payment.rescheduled
              type: string
            loanExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
            loanId:
              $ref: '#/components/schemas/loanId'
            newScheduledDate:
              $ref: '#/components/schemas/newScheduledDate'
            oldScheduledDate:
              $ref: '#/components/schemas/oldScheduledDate'
            transactionExternalId:
              $ref: '#/components/schemas/readOnlyExternalId'
            transactionId:
              $ref: '#/components/schemas/transactionId'
          type: object
      title: payment.rescheduled
    paymentInstrumentType:
      enum:
        - bankAccount
      type: string
    transactionCreatedAt:
      format: date-time
      type: string
    transactionCurrency:
      pattern: '[A-Z]{3}'
      type: string
    transactionIsExternal:
      type: boolean
    transactionScheduledAmount:
      type: number
    transactionScheduledDate:
      format: date
      type: string
    PaymentDueTodayEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            borrowerId:
              $ref: '#/components/schemas/personId'
            eventType:
              enum:
                - payment.due.today
              type: string
            loanId:
              $ref: '#/components/schemas/loanId'
            paymentInstrumentId:
              $ref: '#/components/schemas/paymentInstrumentId'
            paymentInstrumentType:
              $ref: '#/components/schemas/paymentInstrumentType'
            transactionCreatedAt:
              $ref: '#/components/schemas/transactionCreatedAt'
            transactionCurrency:
              $ref: '#/components/schemas/transactionCurrency'
            transactionId:
              $ref: '#/components/schemas/transactionId'
            transactionIsExternal:
              $ref: '#/components/schemas/transactionIsExternal'
            transactionScheduledAmount:
              $ref: '#/components/schemas/transactionScheduledAmount'
            transactionScheduledDate:
              $ref: '#/components/schemas/transactionScheduledDate'
          type: object
      title: payment.due.today
    PaymentHoldDaysExpiredEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            borrowerId:
              $ref: '#/components/schemas/personId'
            eventType:
              enum:
                - payment.hold.days.expired
              type: string
            loanId:
              $ref: '#/components/schemas/loanId'
            transactionId:
              $ref: '#/components/schemas/transactionId'
          type: object
      title: payment.hold.days.expired
    purchaseId:
      description: Purchase's unique identifier.
      type: string
    PurchaseAuthorizedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            cardId:
              $ref: '#/components/schemas/cardId'
            eventType:
              enum:
                - purchase.authorized
              type: string
            purchaseId:
              $ref: '#/components/schemas/purchaseId'
          type: object
      title: purchase.authorized
    PurchaseSettledEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            cardId:
              $ref: '#/components/schemas/cardId'
            eventType:
              enum:
                - purchase.settled
              type: string
            purchaseId:
              $ref: '#/components/schemas/purchaseId'
          type: object
      title: purchase.settled
    PurchaseAppliedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            cardId:
              $ref: '#/components/schemas/cardId'
            eventType:
              enum:
                - purchase.applied
              type: string
            purchaseId:
              $ref: '#/components/schemas/purchaseId'
          type: object
      title: purchase.applied
    lineOfCreditId:
      description: Line of Credit's unique identifier.
      type: string
    PurchaseCreatedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            cardId:
              $ref: '#/components/schemas/cardId'
            eventType:
              enum:
                - purchase.created
              type: string
            lineOfCreditId:
              $ref: '#/components/schemas/lineOfCreditId'
            purchaseId:
              $ref: '#/components/schemas/purchaseId'
          type: object
      title: purchase.created
    newAmount:
      type: number
    newStatus:
      type: string
    oldAmount:
      type: number
    oldStatus:
      type: string
    PurchaseChangedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            cardId:
              $ref: '#/components/schemas/cardId'
            eventType:
              enum:
                - purchase.changed
              type: string
            lineOfCreditId:
              $ref: '#/components/schemas/lineOfCreditId'
            newAmount:
              $ref: '#/components/schemas/newAmount'
            newStatus:
              $ref: '#/components/schemas/newStatus'
            oldAmount:
              $ref: '#/components/schemas/oldAmount'
            oldStatus:
              $ref: '#/components/schemas/oldStatus'
            purchaseId:
              $ref: '#/components/schemas/purchaseId'
          type: object
      title: purchase.changed
    purchaseDisputeId:
      description: Purchase dispute's unique identifier.
      type: string
    purchaseDisputeStatus:
      enum:
        - unsubmitted
        - submitted
        - expired
        - won
        - lost
        - canceled
      type: string
    PurchaseDisputeCreatedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            cardId:
              $ref: '#/components/schemas/cardId'
            drawId:
              $ref: '#/components/schemas/drawId'
            eventType:
              enum:
                - purchase.dispute.created
              type: string
            isPastPurchaseDispute:
              description: >-
                Whether the purchase dispute is for a past purchase or not. Past
                purchases are used in LOC migrations. Past purchases have
                effective dates before the migration cutoff date.
              type: boolean
            purchaseDisputeId:
              $ref: '#/components/schemas/purchaseDisputeId'
            purchaseId:
              $ref: '#/components/schemas/purchaseId'
            status:
              $ref: '#/components/schemas/purchaseDisputeStatus'
          type: object
      title: purchase.dispute.created
    PurchaseDisputeUpdatedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            cardId:
              $ref: '#/components/schemas/cardId'
            drawId:
              $ref: '#/components/schemas/drawId'
            eventType:
              enum:
                - purchase.dispute.updated
              type: string
            isPastPurchaseDispute:
              description: >-
                Whether the purchase dispute is for a past purchase or not. Past
                purchases are used in LOC migrations. Past purchases have
                effective dates before the migration cutoff date.
              type: boolean
            purchaseDisputeId:
              $ref: '#/components/schemas/purchaseDisputeId'
            purchaseId:
              $ref: '#/components/schemas/purchaseId'
            status:
              $ref: '#/components/schemas/purchaseDisputeStatus'
          type: object
      title: purchase.dispute.updated
    creditAgencyId:
      description: Credit agency's unique identifier.
      format: date
      type: string
    startDate:
      format: date
      type: string
    LoanCreditReportingCreatedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            creditAgencyId:
              $ref: '#/components/schemas/creditAgencyId'
            eventType:
              enum:
                - loan.creditreporting.created
              type: string
            startDate:
              $ref: '#/components/schemas/startDate'
          type: object
      title: loan.creditreporting.created
    stopDate:
      format: date
      type: string
    LoanCreditReportingStoppedEvent:
      allOf:
        - $ref: '#/components/schemas/LoanEvent'
        - properties:
            caseId:
              $ref: '#/components/schemas/caseId'
            creditAgencyId:
              $ref: '#/components/schemas/creditAgencyId'
            eventType:
              enum:
                - loan.creditreporting.stopped
              type: string
            stopDate:
              $ref: '#/components/schemas/stopDate'
          type: object
      title: loan.creditreporting.stopped
    obligationId:
      description: Obligation unique identifier.
      type: string
    InterestCapitalizedEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            borrowerId:
              $ref: '#/components/schemas/personId'
            eventType:
              enum:
                - loan.interest.capitalized
              type: string
            feeAmount:
              description: The fee amount capitalized.
              type: number
            interestAmount:
              description: The interest amount capitalized.
              type: number
            isReplay:
              description: |
                `true` if capitalization was updated after the overdue date.
              type: boolean
            loanId:
              $ref: '#/components/schemas/loanId'
            obligationId:
              $ref: '#/components/schemas/obligationId'
          type: object
      title: loan.interest.capitalized
    achFileId:
      description: The ACH File upload monitoring record ID.
      nullable: true
      type: string
    paymentProcessorId:
      description: The payment processor ID.
      type: string
    ACHFileEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            achFileId:
              $ref: '#/components/schemas/achFileId'
            fileName:
              $ref: '#/components/schemas/fileName'
            processorId:
              $ref: '#/components/schemas/paymentProcessorId'
          required:
            - processorId
            - fileName
          type: object
    ACHFileCreatedEvent:
      allOf:
        - $ref: '#/components/schemas/ACHFileEvent'
        - properties:
            eventType:
              enum:
                - ach.file.created
              type: string
          type: object
      title: ach.file.created
    fileDestination:
      description: The destination where we are going to store the ACH File.
      enum:
        - gcp
        - sftp
      type: string
    ACHFileUploadEvent:
      allOf:
        - $ref: '#/components/schemas/ACHFileEvent'
        - properties:
            fileDestination:
              $ref: '#/components/schemas/fileDestination'
          required:
            - fileDestination
          type: object
    ACHFileUploadAttemptedEvent:
      allOf:
        - $ref: '#/components/schemas/ACHFileUploadEvent'
        - properties:
            eventType:
              enum:
                - ach.file.upload.attempted
              type: string
          type: object
      title: ach.file.upload.attempted
    ACHFileUploadFailedEvent:
      allOf:
        - $ref: '#/components/schemas/ACHFileUploadEvent'
        - properties:
            eventType:
              enum:
                - ach.file.upload.failed
              type: string
          type: object
      title: ach.file.upload.failed
    ACHFileUploadSucceededEvent:
      allOf:
        - $ref: '#/components/schemas/ACHFileUploadEvent'
        - properties:
            eventType:
              enum:
                - ach.file.upload.succeeded
              type: string
          type: object
      title: ach.file.upload.succeeded
    amount:
      type: number
    transactionFailureReason:
      enum:
        - insufficientFunds
        - chargeback
        - accountClosed
        - invalidAccount
        - unknownReason
        - invalidCvv
        - invalidExpirationDate
        - avsFailed
        - networkError
        - cardDeclined
        - accountFrozen
        - deceased
        - invalidRouting
        - paymentStopped
        - microdepositsFailed
        - incorrectNumber
        - fraudulent
        - unauthorizedDebit
        - microdepositsAttemptFailed
      type: string
    ReconciliationPaymentFailedEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - properties:
            amount:
              $ref: '#/components/schemas/amount'
            eventType:
              enum:
                - reconciliation.payment.failed
              type: string
            fromInstrumentId:
              $ref: '#/components/schemas/paymentInstrumentId'
            reason:
              $ref: '#/components/schemas/transactionFailureReason'
            settlementIds:
              items:
                $ref: '#/components/schemas/readOnlyExternalId'
              type: array
            toInstrumentId:
              $ref: '#/components/schemas/paymentInstrumentId'
            transactionId:
              $ref: '#/components/schemas/transactionId'
          type: object
      title: reconciliation.payment.failed
    replayId:
      description: Replay's unique identifier.
      type: string
    LoanBalanceChangedEvent:
      properties:
        balances:
          description: >
            The balances of the loan after the balance change.

            Contains a subset of the fields found in the <a
            href="/api-docs/api-public/balances/peach.people.loans.handlers.loan_balances_get">Get
            loan balances</a> response body.
          properties:
            authorizedAmount:
              $ref: '#/components/schemas/AuthorizedAmount'
            availableCreditAmount:
              description: >
                The available credit amount to use. If the borrower exceeded
                their credit limit, the `availableCreditAmount` will be zero.


                For lines of credit only:
                  - `availableCreditAmount` takes into account `authorizedAmount`. Authorized purchases decrease the `availableCreditAmount`.
                  - The amount can be greater than `creditLimitAmount`. It happens only when the total amount of payments made by the borrower
                    plus the total amount of service credits exceeds the line or draw balance. Any future purchases will first deplete the
                    overpayment amount (also called `reimbursementAmount`).

                Only applicable to lines of credit or installment loans with
                multi-advances.
              format: float
              type: number
            calculatedAt:
              description: The date and time the balance was calculated.
              format: date-time
              type: string
            openToBuyAmount:
              $ref: '#/components/schemas/OpenToBuyAmount'
            outstandingBalances:
              description: >
                When a loan is `active`, outstanding balances combine non-due,
                due, and overdue balances. When a loan is

                `accelerated`, outstanding balances are equal to non-accrual
                balances. When a loan is `chargedOff`,

                outstanding balances are equal to charged-off balances.
              properties:
                outstandingFeesAmount:
                  description: |
                    The fees portion of the `outstandingTotalAmount`.
                  format: float
                  type: number
                outstandingInterestAmount:
                  description: The interest portion of the `outstandingTotalAmount`.
                  format: float
                  type: number
                outstandingPrincipalAmount:
                  description: The principal portion of the `outstandingTotalAmount`.
                  format: float
                  type: number
                outstandingTotalAmount:
                  description: >
                    The total outstanding balance sums outstanding principal,
                    interest, and fees. Also called the loan payoff amount.


                    If the loan is charged off, the outstanding totalAmount will
                    be equal to the `chargedOffTotalAmount`.
                  format: float
                  type: number
              type: object
            overdueBalances:
              description: Overdue balances represent balances that are overdue.
              properties:
                overdueTotalAmount:
                  description: >-
                    The total overdue balance sums overdue principal, interest,
                    and fees.
                  format: float
                  type: number
              type: object
            paidBalances:
              description: >
                If loan balance was affected by transaction(s) (e.g. payment),
                this object will contain details of the paid amounts.

                The system will populate `paidBalances` attributes in two
                scenarios:


                1. A transaction, a payment or service credit, was applied
                without triggering a replay. In this scenario, amounts
                   will show how much of the loan balance was paid by the transaction.

                2. A replay was triggered. In this scenario, the system will sum
                up how much of the loan balance was paid by all
                   transactions that were reapplied from "replay start timestamp" until "replay end timestamp". If there were no
                   transactions in the replay period that impacted the loan balance, the `paidTotalAmount` and other attributes in the object will be zeros.

                Outside of these scenarios, the values will be zero.
              properties:
                paidFeesAmount:
                  description: The amount of `paidTotalAmount` allocated to fees.
                  format: float
                  type: number
                paidInterestAmount:
                  description: The amount of `paidTotalAmount` allocated to interest.
                  format: float
                  type: number
                paidOverAmount:
                  description: >
                    Stores any excess amount that was not allocated to
                    principal, interest or fees.


                    For example:

                    - A check in amount greater than outstanding balance was
                    applied.

                    - The overpayment portion (aka balance owed to a borrower)
                    will be reported as `paidOverAmount`.
                  format: float
                  type: number
                paidPrincipalAmount:
                  description: The amount of `paidTotalAmount` allocated to principal.
                  format: float
                  type: number
                paidReimbursementsAmount:
                  description: >-
                    The total amount of reimbursements that were sent back to a
                    borrower.
                  format: float
                  type: number
                paidTotalAmount:
                  description: The paid amount that impacted/lowered the balance.
                  format: float
                  type: number
              type: object
            reimbursementAmount:
              description: >
                The total amount that a lender owes to the borrower. The amount
                was not sent to the borrower yet.

                After a reimbursement is processed, the amount is reduced
                accordingly.
              format: float
              type: number
            utilizationAmount:
              $ref: '#/components/schemas/UtilizationAmount'
          type: object
        borrowerId:
          $ref: '#/components/schemas/personId'
        eventId:
          description: The creatingMessageId of the event that caused the balance change.
          type: string
        eventType:
          enum:
            - loan.balance.changed
          type: string
        interestAccruedAmount:
          description: >-
            The amount of interest accrued. Only set for daily loan maintenance
            and catchup interest accrual.
          format: float
          nullable: true
          type: number
        loanId:
          $ref: '#/components/schemas/loanId'
        replayEndedAt:
          description: Replay ended at timestamp. Only populated for replay events.
          format: date-time
          nullable: true
          type: string
        replayId:
          $ref: '#/components/schemas/replayId'
        replayStartedAt:
          description: Replay started at timestamp. Only populated for replay events.
          format: date-time
          nullable: true
          type: string
      title: loan.balance.changed
      type: object
    supercaseId:
      description: Supercase's unique identifier.
      type: string
    SupercaseChangedEvent:
      allOf:
        - properties:
            eventType:
              enum:
                - supercase.changed
              type: string
            supercaseId:
              $ref: '#/components/schemas/supercaseId'
          type: object
        - $ref: '#/components/schemas/ChangeEvent'
      title: supercase.changed
    GenericEvent:
      properties:
        eventType:
          type: string
      title: generic
      type: object
    eventTypeDefinition:
      description: The dotted event string.
      example: loan.statuschanged
      type: string
    EventPublic:
      anyOf:
        - $ref: '#/components/schemas/AutopayPaymentRescheduledEvent'
        - $ref: '#/components/schemas/AutopayPaymentCanceledEvent'
        - $ref: '#/components/schemas/CancelAutopayScheduleEvent'
        - $ref: '#/components/schemas/AutopayScheduleChangedEvent'
        - $ref: '#/components/schemas/CardReplacementRequestedEvent'
        - $ref: '#/components/schemas/CardCreatedEvent'
        - $ref: '#/components/schemas/CardStatusChangedEvent'
        - $ref: '#/components/schemas/CaseAssociationAddedEvent'
        - $ref: '#/components/schemas/CaseAssociationRemovedEvent'
        - $ref: '#/components/schemas/CaseDoNotInteractCreatedEvent'
        - $ref: '#/components/schemas/CaseDoNotInteractDeletedEvent'
        - $ref: '#/components/schemas/CaseDoNotInteractUpdatedEvent'
        - $ref: '#/components/schemas/CaseDoNotInteractChangedEvent'
        - $ref: '#/components/schemas/CaseDoNotInteractExpiredEvent'
        - $ref: '#/components/schemas/CaseEscalationChangedEvent'
        - $ref: '#/components/schemas/CaseCreatedEvent'
        - $ref: '#/components/schemas/CaseUpdatedEvent'
        - $ref: '#/components/schemas/CaseDeletedEvent'
        - $ref: '#/components/schemas/CaseChangedEvent'
        - $ref: '#/components/schemas/TemplateDescriptorChangedEvent'
        - $ref: '#/components/schemas/TemplateVersionChangedEvent'
        - $ref: '#/components/schemas/TemplateVersionActivatedEvent'
        - $ref: '#/components/schemas/ContactCreatedEvent'
        - $ref: '#/components/schemas/ContactUpdatedEvent'
        - $ref: '#/components/schemas/ContactDeletedEvent'
        - $ref: '#/components/schemas/InteractionBlockedEvent'
        - $ref: '#/components/schemas/LoanClosedEvent'
        - $ref: '#/components/schemas/LoanCreatedEvent'
        - $ref: '#/components/schemas/LoanCreditLimitChangedEvent'
        - $ref: '#/components/schemas/DrawCreditLimitChangedEvent'
        - $ref: '#/components/schemas/LoanCurrentEvent'
        - $ref: '#/components/schemas/LoanFeeCapitalizedEvent'
        - $ref: '#/components/schemas/LoanOverdueEvent'
        - $ref: '#/components/schemas/LoanOverdueUpdateEvent'
        - $ref: '#/components/schemas/LoanLateFeeBookedEvent'
        - $ref: '#/components/schemas/LoanMigrationSucceededEvent'
        - $ref: '#/components/schemas/LoanMigrationFailedEvent'
        - $ref: '#/components/schemas/LoanModificationFeeBookedEvent'
        - $ref: '#/components/schemas/LoanFeeBooked'
        - $ref: '#/components/schemas/LoanFeeCanceledEvent'
        - $ref: '#/components/schemas/LoanFeeChangedEvent'
        - $ref: '#/components/schemas/LoanOwnerChangedEvent'
        - $ref: '#/components/schemas/RemainingBalancesDeferredEvent'
        - $ref: '#/components/schemas/LoanPromoProgramActivatedEvent'
        - $ref: '#/components/schemas/LoanPromoProgramCanceledEvent'
        - $ref: '#/components/schemas/LoanPromoProgramCreatedEvent'
        - $ref: '#/components/schemas/LoanPromoProgramExercisedEvent'
        - $ref: '#/components/schemas/LoanPromoProgramReactivatedEvent'
        - $ref: '#/components/schemas/LoanPromoProgramUpdatedEvent'
        - $ref: '#/components/schemas/LoanRateCreatedEvent'
        - $ref: '#/components/schemas/LoanRateUpdatedEvent'
        - $ref: '#/components/schemas/LoanRefundedEvent'
        - $ref: '#/components/schemas/LoanReimbursementInitiatedEvent'
        - $ref: '#/components/schemas/LoanReimbursementProcessedEvent'
        - $ref: '#/components/schemas/LoanStatusChangedEvent'
        - $ref: '#/components/schemas/PeriodStartedEvent'
        - $ref: '#/components/schemas/ObligationStatusChangedEvent'
        - $ref: '#/components/schemas/SendCommunicationEvent'
        - $ref: '#/components/schemas/StatementCreatedEvent'
        - $ref: '#/components/schemas/PaymentInstrumentCreatedEvent'
        - $ref: '#/components/schemas/PaymentInstrumentUpdatedEvent'
        - $ref: '#/components/schemas/PaymentInstrumentDeactivatedEvent'
        - $ref: '#/components/schemas/PersonBankruptcyDeceasedStartMonitoringEvent'
        - $ref: '#/components/schemas/PersonConsentUpdatedEvent'
        - $ref: '#/components/schemas/PersonCreatedEvent'
        - $ref: '#/components/schemas/PersonSCRAStartMonitoringEvent'
        - $ref: '#/components/schemas/PaymentChargebackEvent'
        - $ref: '#/components/schemas/PaymentChargebackReversedEvent'
        - $ref: '#/components/schemas/PaymentFailedEvent'
        - $ref: '#/components/schemas/PaymentInitiatedEvent'
        - $ref: '#/components/schemas/PaymentPendingEvent'
        - $ref: '#/components/schemas/PaymentReversedEvent'
        - $ref: '#/components/schemas/PaymentScheduledEvent'
        - $ref: '#/components/schemas/PaymentSucceededEvent'
        - $ref: '#/components/schemas/PaymentRescheduledEvent'
        - $ref: '#/components/schemas/PaymentDueTodayEvent'
        - $ref: '#/components/schemas/PaymentHoldDaysExpiredEvent'
        - $ref: '#/components/schemas/PurchaseAuthorizedEvent'
        - $ref: '#/components/schemas/PurchaseSettledEvent'
        - $ref: '#/components/schemas/PurchaseAppliedEvent'
        - $ref: '#/components/schemas/PurchaseCreatedEvent'
        - $ref: '#/components/schemas/PurchaseChangedEvent'
        - $ref: '#/components/schemas/PurchaseDisputeCreatedEvent'
        - $ref: '#/components/schemas/PurchaseDisputeUpdatedEvent'
        - $ref: '#/components/schemas/LoanCreditReportingCreatedEvent'
        - $ref: '#/components/schemas/LoanCreditReportingStoppedEvent'
        - $ref: '#/components/schemas/InterestCapitalizedEvent'
        - $ref: '#/components/schemas/ACHFileCreatedEvent'
        - $ref: '#/components/schemas/ACHFileUploadAttemptedEvent'
        - $ref: '#/components/schemas/ACHFileUploadFailedEvent'
        - $ref: '#/components/schemas/ACHFileUploadSucceededEvent'
        - $ref: '#/components/schemas/ReconciliationPaymentFailedEvent'
        - $ref: '#/components/schemas/LoanBalanceChangedEvent'
        - $ref: '#/components/schemas/SupercaseChangedEvent'
        - $ref: '#/components/schemas/GenericEvent'
      properties:
        eventType:
          $ref: '#/components/schemas/eventTypeDefinition'
      required:
        - eventType
      type: object
    InteractionsPaging:
      allOf:
        - $ref: '#/components/schemas/NewPaginator'
        - properties:
            data:
              items:
                $ref: '#/components/schemas/Interaction'
              type: array
          type: object
    NoteCategory:
      default: generic
      description: |
        Specifies the nature of a Note
      enum:
        - generic
        - escalationCreateReason
        - escalationUpdateReason
        - escalationCancelReason
      type: string
    NoteResponse:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            archived:
              default: false
              description: |
                Set to `true` if the note has been archived.
              type: boolean
            archivedAt:
              format: date-time
              nullable: true
              readOnly: true
              type: string
            archivedBy:
              $ref: '#/components/schemas/UserActionInfo'
              description: |
                Details of the user responsible for archiving the note.
                Can be an agent or automated system process.
            caseId:
              description: Identifier of the case that the note belongs to.
              nullable: true
              readOnly: true
              type: string
            category:
              $ref: '#/components/schemas/NoteCategory'
            content:
              description: The content of the note.
              type: string
            createdBy:
              $ref: '#/components/schemas/UserActionInfo'
              description: |
                Details of the user responsible for creating the note.
                Can be an agent or automated system process.
            deletedAt:
              format: date-time
              nullable: true
              readOnly: true
              type: string
            deletedBy:
              $ref: '#/components/schemas/UserActionInfo'
              description: Latest user identifier who deleted the note.
            edited:
              default: false
              description: |
                Indicates whether the note was edited.
              readOnly: true
              type: boolean
            id:
              description: The note identifier.
              readOnly: true
              type: string
            important:
              default: false
              description: |
                Set to `true` if the note is important.
              type: boolean
            interactionId:
              description: Identifier of the interaction that the note belongs to.
              nullable: true
              readOnly: true
              type: string
            object:
              default: note
              enum:
                - note
              readOnly: true
              type: string
            oldContent:
              type: array
            pinned:
              default: false
              description: |
                Specify that this note should be sorted to the top of the list
                by default.
              type: boolean
            sensitiveData:
              default: false
              description: |
                Indicates whether the note contains sensitive information.
              type: boolean
            status:
              enum:
                - active
                - inactive
              type: string
            supercaseId:
              description: Identifier of the supercase that the note belongs to.
              nullable: true
              readOnly: true
              type: string
            taskableInstruction:
              default: false
              description: >
                Set to `true` if the note is intended to be an instruction which
                creates a review task.
              type: boolean
            type:
              enum:
                - borrowerNote
                - caseNote
                - interactionNote
                - supercaseGlobalNote
                - supercasePrivateNote
              readOnly: true
              type: string
            updatedBy:
              $ref: '#/components/schemas/UserActionInfo'
              description: |
                Details of the user responsible for last updating the note.
                Can be an agent or automated system process.
          type: object
      description: >
        A borrower, case, supercase or interaction can have a note associated
        with it. Each note can only be associated with one of these objects.
      title: A borrower, case, supercase or interaction note
    NoteRequest:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            archived:
              default: false
              description: |
                Set to `true` if the note has been archived.
              type: boolean
            archivedAt:
              format: date-time
              readOnly: true
              type: string
            archivedBy:
              $ref: '#/components/schemas/UserActionInfo'
              description: |
                Details of the user responsible for archiving the note.
                Can be an agent or automated system process.
            caseId:
              description: Identifier of the case that the note belongs to.
              nullable: true
              readOnly: true
              type: string
            category:
              $ref: '#/components/schemas/NoteCategory'
            content:
              description: The content of the note.
              type: string
            createdBy:
              $ref: '#/components/schemas/UserActionInfo'
              description: |
                Details of the user responsible for creating the note.
                Can be an agent or automated system process.
            deletedAt:
              format: date-time
              nullable: true
              readOnly: true
              type: string
            deletedBy:
              $ref: '#/components/schemas/UserActionInfo'
              description: |
                Details of the user responsible for deleting the note.
                Can be an agent or automated system process.
            edited:
              default: false
              description: |
                Indicates whether the note was edited.
              readOnly: true
              type: boolean
            id:
              description: The note identifier.
              readOnly: true
              type: string
            important:
              default: false
              description: |
                Set to `true` if the note is important.
              type: boolean
            interactionId:
              description: Identifier of the interaction that the note belongs to.
              nullable: true
              readOnly: true
              type: string
            pinned:
              default: false
              description: |
                Specify that this note should be sorted to the top of the list
                by default.
              type: boolean
            sensitiveData:
              default: false
              description: |
                Indicates whether the note contains sensitive information.
              type: boolean
            status:
              enum:
                - active
                - inactive
              type: string
            supercaseId:
              description: Identifier of the supercase that the note belongs to.
              nullable: true
              readOnly: true
              type: string
            taskableInstruction:
              default: false
              description: >
                Set to `true` if the note is intended to be an instruction which
                creates a review task.
              type: boolean
            type:
              enum:
                - borrowerNote
                - caseNote
                - interactionNote
                - supercaseGlobalNote
                - supercasePrivateNote
              readOnly: true
              type: string
            updatedBy:
              $ref: '#/components/schemas/UserActionInfo'
              description: |
                Details of the user responsible for last updating the note.
                Can be an agent or automated system process.
          type: object
      description: >
        A borrower, case, supercase or interaction can have a note associated
        with it. Each note can only be associated with one of these objects.
      title: A borrower, case, supercase or interaction note
    APIKeyDescription:
      description: >
        A description of the API key. This field is optional and can be used to
        provide additional context about the API key.
      maxLength: 200
      minLength: 1
      nullable: true
      type: string
    WhitelistedIPs:
      description: >
        IP addresses or CIDR blocks for which to restrict access to this API
        key.
      example:
        - 1.1.1.1
        - 2.2.2.2
        - 10.10.0.0/16
      items:
        type: string
      nullable: true
      type: array
    ResponseAPIKeyNoSecret:
      properties:
        companyId:
          type: string
        createdAt:
          format: date-time
          type: string
        deletedAt:
          format: date-time
          type: string
        description:
          $ref: '#/components/schemas/APIKeyDescription'
        id:
          type: string
        key:
          type: string
        status:
          enum:
            - active
            - inactive
          type: string
        updatedAt:
          format: date-time
          type: string
        userId:
          type: string
        whitelistedIPs:
          $ref: '#/components/schemas/WhitelistedIPs'
      type: object
    RequestBodyAPIKeyNoSecret:
      properties:
        description:
          $ref: '#/components/schemas/APIKeyDescription'
        userId:
          type: string
        whitelistedIPs:
          $ref: '#/components/schemas/WhitelistedIPs'
      required:
        - userId
      type: object
    APIKeyAPIVersion:
      description: >
        The version of the API this API key is tied to. Must be in the format
        `YYYY-MM-DD`. For example, `2024-05-22`.
      example: '2024-05-22'
      pattern: ^\d{4}-\d{2}-\d{2}$
      type: string
    RequestBodyAPIKeyUpdateAPIVersioning:
      properties:
        apiVersion:
          $ref: '#/components/schemas/APIKeyAPIVersion'
        description:
          $ref: '#/components/schemas/APIKeyDescription'
        whitelistedIPs:
          $ref: '#/components/schemas/WhitelistedIPs'
      type: object
    ResponseAPIKeyNoSecretAPIVersioning:
      properties:
        apiVersion:
          $ref: '#/components/schemas/APIKeyAPIVersion'
        apiVersionDowngradeNotAllowedAfter:
          description: >
            A UTC timestamp corresponding to when the API key's version can no
            longer be downgraded. This timestamp is set to 7 days after the API
            key's version is updated.
          format: date-time
          type: string
        apiVersionUpdatedAt:
          description: >
            A UTC timestamp corresponding to when the API key's version was last
            updated. This timestamp is updated when the API key's version is
            updated.
          format: date-time
          type: string
        companyId:
          type: string
        createdAt:
          format: date-time
          type: string
        deletedAt:
          format: date-time
          type: string
        description:
          $ref: '#/components/schemas/APIKeyDescription'
        id:
          type: string
        key:
          type: string
        status:
          enum:
            - active
            - inactive
          type: string
        updatedAt:
          format: date-time
          type: string
        userId:
          type: string
        whitelistedIPs:
          $ref: '#/components/schemas/WhitelistedIPs'
      type: object
    FeeApiName:
      description: |
        The identifier of the dynamic fee configuration for this loan.
        Only applicable to `type=dynamicFee` fee.
      example: modificationFee
      type: string
    FeeDisplayName:
      description: >
        The display name of the fee. The display name of the fee is either set
        by `customDisplayName` (that can be passed in the API)

        or by `displayName` that was configured in the loan type (this is the
        default value.)
      example: Modification fee
      type: string
    IndexRate:
      description: >
        The index interest rate for a loan type. The index rate is used in
        conjunction with an interest rate

        on a loan of type `spread` to calculate the effective interest rate for
        that loan.
      properties:
        annualRate:
          description: >-
            The annual interest rate value for the period defined. Format is
            decimal. For example, 0.01 is 1% annual rate, 0.2 is 20% annual
            rate.
          format: float
          type: number
        country:
          description: |
            Country. English short name according to
            [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
          maxLength: 2
          minLength: 2
          type: string
        endDate:
          description: >
            The index rate end date in the product timezone.


            The end date is inclusive (i.e., the rate is also applied on the end
            date).


            If set to `null`, the rate is applicable until it changes.


            WARNING: If there is no index rate available for a given date, the
            system will assume

            that the index rate is 0. It is highly recommended that you set the
            "last" index rate's

            end date to `null`, so that there is always an index rate that is
            applicable.
          format: date
          nullable: true
          type: string
        externalId:
          $ref: '#/components/schemas/externalId'
          description: The external unique identifier of the index rate.
        indexDescription:
          description: >
            The index interest rate description. For example: "1 Month LIBOR
            Rate" or "Custom rate".
          type: string
        startDate:
          description: >
            The start date of the index rate in the product timezone.


            The start date is inclusive (i.e., the rate is applied on the start
            date).


            When a new Index Interest Rate value is added, the previous rate

            (if it exists) will have its end date set to one calendar day before

            the new rate's start date.


            If the new rate's start date is in the past, the Peach system will
            replay all

            "active" loans with the new Index Interest Rate value and re-accrue
            loans' interest.

            (To clarify, it applied to the "active" loans at the time of

            Index Interest Rate addition.)


            WARNING: Replaying the entire portfolio of loans might take a long
            time.

            It is recommended that you set the new Index Interest Rate at night.
          format: date
          type: string
      required:
        - annualRate
        - startDate
      type: object
    IndexRateResult:
      allOf:
        - properties:
            id:
              description: The index rate's unique identifier.
              readOnly: true
              type: string
          type: object
        - $ref: '#/components/schemas/IndexRate'
    IndexRatePaging:
      allOf:
        - $ref: '#/components/schemas/Paging'
        - properties:
            data:
              items:
                $ref: '#/components/schemas/IndexRateResult'
              type: array
          type: object
    IndexRateUpdate:
      properties:
        annualRate:
          description: >-
            The annual interest rate value for the period defined. Format is
            decimal. For example, 0.01 is 1% annual rate, 0.2 is 20% annual
            rate.
          format: float
          type: number
        endDate:
          description: >
            The index rate end date in the product timezone. The end date is
            inclusive. Pass `null` if you do not know when the rate will expire.
            If

            `null`, the rate is applicable until it changes.
          format: date
          nullable: true
          type: string
        indexDescription:
          description: >
            The index interest rate description. For example: "1 Month LIBOR
            Rate" or "Custom rate".
          type: string
      type: object
    LoansPaging:
      allOf:
        - $ref: '#/components/schemas/NewPaginator'
        - properties:
            data:
              items:
                allOf:
                  - $ref: '#/components/schemas/Loan'
                  - properties:
                      mainBorrowerExternalId:
                        description: >-
                          The external identifier of the main borrower of the
                          loan.
                        type: string
                      newInterestTimestampStartedAt:
                        description: >-
                          The timestamp of when the new interest timestamp
                          started.
                        format: date-time
                        nullable: true
                        type: string
                    type: object
              type: array
          type: object
      title: loans
    LoansMinimalPaging:
      allOf:
        - $ref: '#/components/schemas/NewPaginator'
        - properties:
            data:
              items:
                properties:
                  externalId:
                    description: The external identifier of the loan.
                    type: string
                  id:
                    type: string
                  loanTypeId:
                    description: >-
                      The loan type identifier. This is created specifically for
                      each lender's loan product by Peach.
                    type: string
                  lockStatus:
                    description: |
                      Is the loan locked for replay?
                    type: boolean
                  mainBorrowerExternalId:
                    description: The external identifier of the main borrower of the loan.
                    type: string
                  mainBorrowerId:
                    description: The identifier of the main borrower of the loan.
                    type: string
                  migrationStatus:
                    default: nonMigrated
                    description: >
                      The loan migration status. This attribute can be updated
                      by the Peach system only.

                        - `nonMigrated` - this is a non-migrated loan. Most loans are expected to be `nonMigrated`.
                        - `prepMigration` - the lender can add objects to the loan in the past.
                        - `migrating` - the system is migrating the loan. Objects cannot be modified or added.
                        - `completed` - the loan was successfully migrated. After a successful migration the loan status will be changed to one of the following statuses: `active`, `accelerated`, `chargedOff` or `paidOff`.
                        - `failed` - the loan migration attempt failed. The loan will remain in the `pending` status. You can update the loan details and try to migrate again by calling `Migrate loan` endpoint.
                    enum:
                      - nonMigrated
                      - prepMigration
                      - migrating
                      - completed
                      - failed
                    type: string
                  newInterestTimestampStartedAt:
                    description: The timestamp of when the new interest timestamp started.
                    format: date-time
                    nullable: true
                    type: string
                type: object
              type: array
          type: object
    NotificationType:
      allOf:
        - $ref: '#/components/schemas/VersionedMixin'
        - properties:
            channel:
              allOf:
                - nullable: true
                  type: string
                - $ref: '#/components/schemas/InteractionChannel'
            delay:
              description: >
                Length of time after a triggering condition to wait before
                sending notification.
              nullable: true
              type: integer
            onCondition:
              $ref: '#/components/schemas/onCondition'
            onOutcome:
              $ref: '#/components/schemas/ProcessOutcome'
            onStatus:
              $ref: '#/components/schemas/ProcessStatus'
            templateId:
              description: >
                Communication template identifier to create and send
                notification.
              nullable: true
              type: integer
            theme:
              allOf:
                - nullable: true
                  type: string
                - $ref: '#/components/schemas/InteractionTheme'
            unit:
              description: |
                Time units for setting the `delay` time.
              enum:
                - calendarDays
                - businessDays
              nullable: true
              type: string
          type: object
      title: notificationHandler
    PaymentProcessorFundingInstrument:
      properties:
        id:
          type: string
        status:
          description: >
            Status of the funding instrument.

            - `active` - the instrument can be used for reconciliation payments.

            - `pending` - the instrument is pending to be verified.

            - `inactive` - the instrument is not active and cannot be used for
            reconciliation payments.
          enum:
            - active
            - inactive
            - pending
          type: string
      type: object
    PaymentProcessorMutableFields:
      allOf:
        - $ref: '#/components/schemas/BaseWithExternalIdMixin'
        - properties:
            achBatchHeaderCompanyId:
              description: >
                Data element that is part of the batch header record. For
                example: `2837461011`.
              type: string
            achBatchHeaderCompanyName:
              description: >
                Data element that is part of the batch header record. For
                example: `PEACH FIN ACH`.
              type: string
            achBatchHeaderOriginatingDFIId:
              description: >
                Data element that is part of the batch header record. For
                example: `12773923`.


                If the value is NOT provided (aka null or empty) as part of the
                configuration, the system will automatically set this value to
                `achFileHeaderImmediateDestination` without the last digits.

                For example: if `achFileHeaderImmediateDestination=121140399`,
                the system will set `achBatchHeaderOriginatingDFIId=12114039`.
              type: string
            achCutoff:
              description: >
                The cutoff time for ACH processing, in the payment processor's
                timezone. Use 24-hour format. For example: "19:00"
              format: time
              type: string
            achFeeAmount:
              description: >
                The fee charged by the payment processor for regular ACH
                transactions. For example: 0.05
              format: float
              type: number
            achFeeType:
              description: >
                How the fee is charged by the payment processor. If the full
                amount is transferred, and fees are charged monthly, use
                `gross`.

                If fees are deducted from the amount transferred, use `net`.
              enum:
                - gross
                - net
              type: string
            achFileHeaderImmediateDestination:
              description: >
                Data element that is part of the file header record. For
                example: `121140399`.
              type: string
            achFileHeaderImmediateDestinationName:
              description: >
                Data element that is part of the file header record. For
                example: `SILICON VALLEY BANK`.
              type: string
            achFileHeaderImmediateOrigin:
              description: >
                Data element that is part of the file header record. For
                example: `1456726789`.
              type: string
            achFileHeaderImmediateOriginName:
              description: >
                Data element that is part of the file header record. For
                example: `PEACH FINANCE INC`.
              type: string
            achSECCode:
              default: PPD
              description: |
                The Standard Entry Class Code within ACH.
              enum:
                - CCD
                - PPD
                - WEB
              type: string
            achSameDayCutoff:
              description: >
                The cutoff time for ACH same day processing, in the payment
                processor's timezone. Use 24-hour format. For example: "10:00"
              format: time
              type: string
            achSameDayFeeAmount:
              description: >
                The fee charged by the payment processor for same day ACH
                transactions. For example: 0.50
              format: float
              type: number
            encryptionMethodIncoming:
              description: >
                The encryption method that Peach system will use to decrypt the
                incoming files to Peach.

                Make sure you use `peachPublicKey` to encrypt the files sent to
                Peach or uploaded to SFTP for Peach. Keep the value empty if no
                encryption is needed.
              enum:
                - GPG
              nullable: true
              type: string
            encryptionMethodOutgoing:
              description: >
                The encryption method that Peach system will use to encrypt the
                outgoing files from Peach. Keep the value empty if no encryption
                is needed.

                If `encryptionMethodOutgoing` is set, a value must be set for
                `thirdPartyPublicKey`.
              enum:
                - GPG
              nullable: true
              type: string
            isDefault:
              default: false
              description: >
                Mark the payment processor as default for the company. Only one
                payment processor can be default. If a new payment processor is
                created

                with `isDefault=true` and there is another payment processor
                with `isDefault=true`, the system will set `isDefault=false` for
                the

                other/existing processor.
              type: boolean
            isFileNameDefaultConvention:
              default: true
              description: >
                - If `true`, files (e.g. ACH) will be named based on the
                `ACHP_MMDDYYYYHHMM` convention. For example:
                `ACHP_110320211305`.

                - If `false`, files (e.g. ACH) will be named based on a custom
                implementation. Do not set `false` unless you've coordinated
                with the Peach team.
              type: boolean
            peachPublicKey:
              description: |
                Peach's public key to encrypt the incoming files to Peach.
              readOnly: true
              type: string
            privateKeyExpires:
              default: false
              description: >
                - Only applicable when `signOutgoing` is `true`. Setting this to
                `true` when `signOutgoing` is `false` will return an error.

                - If true, the private key generated for signing outgoing files
                will have an expiration date of 2 years from the time of
                generation.

                - If false (default), the private key does not expire.
              type: boolean
            processorName:
              description: >
                The name of the payment processor. For example: Silicon Valley
                Bank or Wells Fargo.
              type: string
            sftpAccessMethod:
              default: usernamePassword
              description: >
                The method used to access the `sftpHostname`.

                - If `usernamePassword`, then `sftpUsername` and `sftpPassword`
                must be provided.

                - If `keys`, then `sftpSSHPeachPrivateKey` and
                `sftpSSHPeachPublicKey` will be created by peach.
              enum:
                - usernamePassword
                - keys
                - disabled
              type: string
            sftpAchConfirmationFileNameRegex:
              description: >
                The name of the ACH confirmation file. The format is a regular
                expression.

                If you are not sure how to set up the regular expression, please
                contact the Peach team by providing a few examples of file
                names.


                If the value is null, we assume that the processor doesn't
                support ACH confirmation files and any upload of an ACH file is
                considered as successful.
              nullable: true
              type: string
            sftpAchReturnFileNameRegex:
              description: >
                The name of the ACH return file. The format is a regular
                expression.

                If you are not sure how to set up the regular expression, please
                contact the Peach team by providing a few examples of file
                names.
              type: string
            sftpCdDirInbox:
              description: >
                The folder where files (e.g. ACH returns) will be downloaded
                from. The system will change directory into this folder before

                performing the download.
              type: string
            sftpCdDirOutbox:
              description: >
                The folder where files (e.g. ACH instructions) will be uploaded.
                The system will change directory into this folder before

                performing the upload.
              type: string
            sftpHostname:
              description: >
                The hostname for SFTP. Host name should not contain a scheme, so
                don't put `sftp://` on the front. You may optionally specify a
                port

                like so: `example.com:222`. If no port is supplied a default of
                22 will be used.
              pattern: ^[^/]+$
              type: string
            sftpPassword:
              description: The password for SFTP.
              nullable: true
              type: string
              writeOnly: true
            sftpSSHDisabledAlgorithms:
              description: >-
                A json object of any algorithms that need to be disabled when
                accessing `sftpHostname` with a private key. This should be null
                in most scenarios.
              nullable: true
              type: object
            sftpSSHPeachPublicKey:
              description: |
                Peach public key to used to log into sftpHostname.
              readOnly: true
              type: string
            sftpUsername:
              description: The username for SFTP.
              nullable: true
              type: string
            signOutgoing:
              default: false
              description: >
                - If true, outgoing files will be encrypted with
                `thirdPartyPublicKey` and signed with peach's private key. Make
                sure to set `encryptionMethodOutgoing` and `thirdPartyPublicKey`
                values.

                - If false, outgoing files will not be signed with peach's
                private key.
              type: boolean
            status:
              description: |
                The status of the payment processor.
                 - `draft` - the payment processor is in the process of being configured and not ready to be used.
                 - `active` - the payment processor is ready to process payments.
                 - `deprecated` - the payment processor was deprecated, and new payments cannot be processed.
              enum:
                - draft
                - active
                - deprecated
              type: string
            thirdPartyPublicKey:
              description: >
                The third party's (e.g. lender or bank) public key to use to
                encrypt the outgoing files from Peach. A value must be passed if
                `encryptionMethodOutgoing` is set.
              nullable: true
              type: string
              writeOnly: true
            timezone:
              description: >
                The timezone used by this payment processor. For example:
                "America/Los_Angeles"
              type: string
          type: object
    SuccessfulStatusTransition:
      properties:
        dayType:
          $ref: '#/components/schemas/DayType'
        numDays:
          minimum: 1
          type: integer
      type: object
    PaymentProcessorResponseFields:
      properties:
        isExternal:
          description: >
            When `true`, the payment processor is external to Peach-managed ACH
            processing.
          readOnly: true
          type: boolean
        isSettlementRequired:
          description: >
            When `true`, Peach manages investor settlement for transactions
            processed by this

            payment processor. Settlement transfers are created automatically
            when payments are

            received, and reconciliation transactions are wired to investors
            based on available

            balance data from BAI files provided by Peach's bank.


            **This is a Peach-internal configuration and cannot be enabled by
            lenders.** Only

            the Peach-managed ACH processor supports automated investor
            settlement. Third-party

            payment processors do not provide BAI files to Peach and therefore
            cannot participate

            in this flow.
          readOnly: true
          type: boolean
        successfulStatusTransition:
          allOf:
            - $ref: '#/components/schemas/SuccessfulStatusTransition'
          readOnly: true
      type: object
    PaymentProcessor:
      allOf:
        - properties:
            fundingInstruments:
              description: >-
                The funding instruments that are associated with the payment
                processor.
              items:
                $ref: '#/components/schemas/PaymentProcessorFundingInstrument'
              readOnly: true
              type: array
            paymentTypes:
              description: >-
                The payment types that will be processed by the payment
                processor. Currently, `ach` is supported only.
              items:
                enum:
                  - ach
                  - debitCard
                  - creditCard
                type: string
              type: array
            processorType:
              description: >
                The type of payment processor.

                - `achDirectUS` - Peach system will create NACHA files and
                upload directly to lender's bank SFTP.
              enum:
                - achDirectUS
              type: string
          type: object
        - $ref: '#/components/schemas/PaymentProcessorMutableFields'
        - $ref: '#/components/schemas/PaymentProcessorResponseFields'
      required:
        - paymentTypes
        - processorType
        - processorName
        - status
        - timezone
        - sftpAchReturnFileNameRegex
        - sftpAccessMethod
      title: Payment Processor
    PaymentProcessorCreateOnlyFields:
      properties:
        isExternal:
          default: false
          description: >
            When `true`, the payment processor is external to Peach-managed ACH
            processing.
          type: boolean
        isSettlementRequired:
          default: false
          description: >
            When `true`, Peach manages investor settlement for transactions
            processed by this

            payment processor.
          type: boolean
        successfulStatusTransition:
          description: >
            Defines when a transaction transitions to succeeded after
            processing.

            If both `dayType` and `numDays` are omitted or null, defaults to
            `business` and `3`.
          nullable: true
          properties:
            dayType:
              enum:
                - business
                - calendar
              nullable: true
              type: string
            numDays:
              minimum: 1
              nullable: true
              type: integer
          type: object
      type: object
    PaymentProcessorCreateRequest:
      allOf:
        - properties:
            paymentTypes:
              description: >-
                The payment types that will be processed by the payment
                processor. Currently, `ach` is supported only.
              items:
                enum:
                  - ach
                  - debitCard
                  - creditCard
                type: string
              type: array
            processorType:
              description: >
                The type of payment processor.

                - `achDirectUS` - Peach system will create NACHA files and
                upload directly to lender's bank SFTP.
              enum:
                - achDirectUS
              type: string
          type: object
        - $ref: '#/components/schemas/PaymentProcessorMutableFields'
        - $ref: '#/components/schemas/PaymentProcessorCreateOnlyFields'
    PaymentProcessorUpdateRequest:
      allOf:
        - properties:
            updatePeachKeys:
              default: false
              description: >
                - If true, the peach keys for encrypting and decrypting incoming
                files to Peach are updated. The new `peachPublicKey` value is
                returned.

                - If false, the peach encryption keys are not changed
              type: boolean
              writeOnly: true
          type: object
        - $ref: '#/components/schemas/PaymentProcessorMutableFields'
    BorrowerPaging:
      allOf:
        - $ref: '#/components/schemas/NewPaginator'
        - properties:
            data:
              items:
                $ref: '#/components/schemas/Borrower'
              type: array
          type: object
    PersonSearchPaging:
      allOf:
        - properties:
            data:
              items:
                $ref: '#/components/schemas/Person'
              type: array
            search:
              properties:
                maxScore:
                  description: >
                    Number representing the maximum scoring result in the
                    results.
                  format: float
                  type: number
                scores:
                  description: >
                    Object mapping result ID's to their score in the search
                    results.
                  type: object
              type: object
          type: object
    BorrowerNoIdentity:
      anyOf:
        - $ref: '#/components/schemas/PersonNoIdentity'
        - $ref: '#/components/schemas/BusinessNoIdentity'
    CanInteractCommonProps:
      description: >
        The common parameters of a request to determine whether the interaction
        is

        allowed based on the history of interactions with a borrower and the

        associated cases.


        Either a `theme` or `subject` is required.
      properties:
        channel:
          $ref: '#/components/schemas/InteractionChannel'
        checkAtCompanyNoon:
          description: >
            If `true`, do time-based checks based on noon today, instead of

            now. This does not override other reasons a check can fail: the
            borrower

            having a Do Not Interact in place, having reached the interaction

            frequency limit, etc.  This is useful for generating borrower
            campaigns

            in the morning to be carried out during business hours.


            Where possible, it's always better to check permission right before
            an

            action. Many things can change (payments are made, other automated

            interactions are sent, consents/addresses can be updated) from when
            you

            plan something to happen to when it actually happens. Lenders are

            responsible for ensuring it is still permissible to conduct the

            interaction.
          type: boolean
        isAutodialed:
          default: false
          description: >
            `true` if an interaction is prerecorded or autodialed call. This
            attribute

            is relevant when channel=`voice`. If no value is passed, we'll
            assume

            isAutodialed=`false` (meaning manual call). If isAutodialed=`true`
            and

            the contact's consentAutodialedCall=`false` we'll return
            result=`false`.

            For more information read Telephone Consumer Protection Act (TCPA).
          nullable: true
          type: boolean
        loanId:
          $ref: '#/components/schemas/AssociatedLoanId'
        loanIds:
          $ref: '#/components/schemas/AssociatedLoanIds'
        loansFromCollCase:
          $ref: '#/components/schemas/LoansFromCollCase'
        subject:
          $ref: '#/components/schemas/InteractionSubject'
        theme:
          $ref: '#/components/schemas/InteractionTheme'
      required:
        - channel
      type: object
    CanInteractByContactIdentifier:
      allOf:
        - $ref: '#/components/schemas/CanInteractCommonProps'
        - properties:
            contactExternalId:
              description: |
                The lender's identifier of the contact information.
              type: string
              writeOnly: true
            contactId:
              description: |
                An identifier of an existing contact.
              type: string
          required:
            - contactId
          type: object
      title: canInteractByContactId
    InteractionCanInteractResult:
      properties:
        result:
          type: boolean
      type: object
    DoNotInteractEndDate:
      description: >
        A future date when interaction restrictions will be lifted.

        The value format is date only, without time. If today is `endDate`, the

        restriction will remain until the end of day in the product timezone.

        If no value is provided, `doNotInteract` will remain in effect until

        `Remove do not interact` is called or `endDate` is set to a date in the
        past.
      format: date
      nullable: true
      type: string
    schemas-TimeOfDay:
      properties:
        fromHour:
          description: >
            From hour in the borrower's home address timezone. Value range is
            0-23. 0=Midnight...23=11 PM.

            `fromHour` must be smaller than `toHour`.
          format: int32
          type: number
        toHour:
          description: >
            To hour in the borrower's home address timezone. Value range is
            0-23. 0=Midnight...24=Midnight of following day.

            `fromHour` must be smaller than `toHour`.
          format: int32
          type: number
      required:
        - fromHour
        - toHour
      type: object
    DoNotInteractUpdate:
      description: >
        Update the Do Not Interact.


        The only data that can be updated after creation of a `doNoInteract` are
        external reference and

        the ending date.
      properties:
        caseId:
          description: Identifier of the case to which the `doNotInteract` belongs.
          readOnly: true
          type: string
        channels:
          description: >
            Channel(s) for which outbound interactions with a borrower are
            blocked.

            Use value `all` for all channels.
          items:
            $ref: '#/components/schemas/DoNotInteractChannel'
          type: array
        contactLabels:
          description: |
            A list of contact labels.
            A person's mobile phone is labeled as `personal`.
            A person's work phone is labeled as `work`.
            A person's home phone is labeled as `home`.
            A person's home address is labeled as `home`.
          items:
            $ref: '#/components/schemas/ContactLabel'
          type: array
        daysOfWeek:
          description: >
            A list of days of week at which to block. 


            Valid range is 1-7. 1=Monday...7=Sunday. For example: `[1, 2, 4]`.


            - If the day of week matches *any* of the values specified here,
            then the interaction is blocked.

            - If this array is empty, then the interaction is blocked for all
            days of week.
          example:
            - 1
            - 2
            - 4
          items:
            format: int32
            type: number
          type: array
        endDate:
          $ref: '#/components/schemas/DoNotInteractEndDate'
        object:
          default: doNotInteract
          enum:
            - doNotInteract
          readOnly: true
          type: string
        personId:
          description: Identifier of the borrower to which the `doNotInteract` belongs.
          readOnly: true
          type: string
        source:
          default: service
          description: >
            How the `DoNotInteract` instance was created. This is used by the
            internal case processing to determine

            whether to stop blocking interactions when the `Case` changes state.
            This may not be returned by

            default depending on your configuration.


            The possible values are:


            * `api`: created by an external user through an authorized HTTP
            request to the API

            * `service`: created by internal server process, or an API call from
            a recognized Peach service within the

            virtual private cloud (VPC)

            * `manual`: created by SQL or manual entry, this is prevented except
            for rare maintenance situations.
          enum:
            - api
            - service
            - manual
          readOnly: true
          type: string
        themes:
          description: >
            Theme(s) for which outbound interactions with a borrower are
            blocked. Use value

            `all` for all themes. `all` doesn't include `opsAccountCredentials`.

            For example, use `opsCollDebt` to stop debt collection interactions.
          items:
            $ref: '#/components/schemas/DoNotInteractTheme'
          type: array
        timesOfDay:
          description: >
            A list of times of day at which to block—in hour resolution.


            - If the time falls into *any* of the ranges specified here, then

            the interaction is blocked.

            - If this array is empty, then the interaction is blocked for all
            times of day.
          items:
            $ref: '#/components/schemas/schemas-TimeOfDay'
          type: array
        timezone:
          description: >
            The time zone where the borrower is located. If provided, the time
            zone will be used for restriction. If not provided, the system will
            use the borrower's home address time zone.
          type: string
      title: doNotInteract
      type: object
    DoNotInteract:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - $ref: '#/components/schemas/DoNotInteractUpdate'
        - description: >
            Channel(s) and theme(s) for which interactions with a borrower are
            blocked.

            Interactions with theme=`outOpsServicing` cannot be blocked since
            they

            are typically initiated by a borrower.
          properties:
            startDate:
              description: >
                The start date for blocking interactions with a borrower. The
                value format is date

                only, without time. The start date can be a future date.

                If the value is not provided, or equal to today's date, or a
                date in the past, then the

                `doNotIteract` will be effective as soon as we process the
                request.
              format: date
              type: string
          type: object
      title: doNotInteract
    ConsentItem:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            name:
              description: >
                Represents special consents or permissions. Consents are
                typically

                given in writing to a lender.


                - `electronicComms` - Set to `revoked` if the borrower hasn't
                consented or

                has revoked consent to electronic communications. Default:
                `consented`


                - `contactPersonWork` - A borrower or their attorney gave a
                written

                consent to contact borrower's employer for debt collection.
                Default: `revoked`


                - `contactPersonRepByAttorney` - Indicates whether a lender is

                allowed to contact a borrower represented by an attorney. If the
                attorney

                gave a written consent to interact with the borrower, set

                to `consented`. Default: `revoked`


                - `contactPersonUnusualTime` - A person or their attorney gave

                written consent to interact with the person at some unusual

                place or time. Default: `revoked`


                - `autodialedColl` - Consent to receive autodialed or
                pre-recorded

                collection calls from creditors or third-party collectors. If no

                value is provided, we will assume autodialedColl is `consented`.
                For

                more information read Telephone Consumer Protection Act (TCPA).

                Default: `consented`


                - `executeWageAssignment` - Set to `consented` if the person
                consented to

                execute a wage assignment agreement. Default: `revoked`


                - `contactServicememberUnitOrCommander` - Consent to contact a

                servicemember's military unit or chain of command to collect on
                a debt. Default: `revoked`.
              enum:
                - electronicComms
                - contactPersonWork
                - contactPersonRepByAttorney
                - contactPersonUnusualTime
                - autodialedColl
                - executeWageAssignment
                - contactServicememberUnitCollDebt
              type: string
            object:
              default: consent
              enum:
                - consent
              readOnly: true
              type: string
            value:
              description: |
                Consent can be granted and revoked by a borrower.
              enum:
                - consented
                - revoked
              type: string
          required:
            - name
            - value
          type: object
      title: consent
    Consents:
      items:
        $ref: '#/components/schemas/ConsentItem'
      type: array
    ConsentArray:
      allOf:
        - $ref: '#/components/schemas/Paging'
        - properties:
            data:
              $ref: '#/components/schemas/Consents'
          type: object
      title: consent
    DocumentUploadLink:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            caseId:
              description: The identifier of the case associated with the doc upload link
              nullable: true
              type: string
            contactId:
              description: >-
                The identifier of the contact to which the doc upload link will
                be sent
              type: string
          type: object
    DocumentDescriptorUpdate:
      allOf:
        - $ref: '#/components/schemas/BaseWithExternalIdMixin'
        - $ref: '#/components/schemas/DocumentDescriptorFields'
        - properties:
            type:
              $ref: '#/components/schemas/DocumentType'
          type: object
    IdentityPaging:
      allOf:
        - $ref: '#/components/schemas/Paging'
        - properties:
            data:
              items:
                $ref: '#/components/schemas/Identity'
              type: array
          type: object
    LegalRepresentative:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - description: |
            Contains details about an entity that legally represents a borrower.
          properties:
            address:
              $ref: '#/components/schemas/Address'
            email:
              description: The email address of a legal entity.
              type: string
            name:
              $ref: '#/components/schemas/Name'
            object:
              default: legalRepresentative
              enum:
                - legalRepresentative
              readOnly: true
              type: string
            otherEmail:
              description: An additional email address of a legal entity.
              type: string
            otherPhone:
              description: >
                An additional phone number of a legal entity. This should be
                provided in

                [E.164](https://en.wikipedia.org/wiki/E.164) format.
              type: string
            phone:
              description: |
                The phone number of a legal entity. This should be provided in
                [E.164](https://en.wikipedia.org/wiki/E.164) format.
              type: string
            status:
              description: Legal representative's status.
              enum:
                - active
                - nonResponsive
                - inactive
                - archived
              type: string
            statusUpdatedAt:
              description: The time of status update.
              format: date-time
              readOnly: true
              type: string
            validAddress:
              $ref: '#/components/schemas/ValidAddress'
          type: object
      title: legalRepresentative
    LegalRepresentativesPaging:
      allOf:
        - $ref: '#/components/schemas/Paging'
        - properties:
            data:
              description: |
                Array of legal entities
              items:
                $ref: '#/components/schemas/LegalRepresentative'
              type: array
          type: object
      title: legalRepresentative
    NewInstallmentAtOriginationRequirements:
      properties:
        atOrigination:
          required:
            - amountFinanced
            - duration
            - interestRates
            - paymentFrequency
            - originationLicense
            - originatingCreditorName
          type: object
      type: object
    NewInstallment:
      allOf:
        - properties:
            timestamps:
              description: >
                **DEPRECATED** The fields in this object will not affect the
                loan.
            type:
              enum:
                - installment
              type: string
          required:
            - loanTypeId
            - servicedBy
            - status
          type: object
        - $ref: '#/components/schemas/Installment'
        - $ref: '#/components/schemas/NewInstallmentAtOriginationRequirements'
      title: Installment
    NewLineOfCreditAtOriginationRequirements:
      properties:
        atOrigination:
          required:
            - creditLimitAmount
            - interestRates
            - paymentFrequency
            - originationLicense
            - originatingCreditorName
          type: object
      type: object
    NewLineOfCredit:
      allOf:
        - properties:
            timestamps:
              description: >
                **DEPRECATED** The fields in this object will not affect the
                loan.
            type:
              enum:
                - lineOfCredit
              type: string
          required:
            - loanTypeId
            - servicedBy
            - status
          type: object
        - $ref: '#/components/schemas/LineOfCredit'
        - $ref: '#/components/schemas/NewLineOfCreditAtOriginationRequirements'
      title: Line of Credit
    NewLoan:
      anyOf:
        - $ref: '#/components/schemas/NewInstallment'
        - $ref: '#/components/schemas/NewLineOfCredit'
      description: |
        Represents a loan. A loan always belongs to a borrower, and most of
        the interactions between a lender and a borrower are associated with a
        particular loan.
      title: newLoan
    LoanAccelerate:
      allOf:
        - properties:
            effectiveDate:
              description: >
                The effective date of the loan acceleration. The date should be
                the current date in the product timezone.

                Passing in `"today"` will also set the field to today's date.
              format: date
              type: string
            sendNotice:
              default: true
              description: >-
                When set to `false`, the system will NOT send a
                `loanAccelerated` notice to the borrower.
              type: boolean
          type: object
        - $ref: '#/components/schemas/CaseId'
      required:
        - effectiveDate
    LoanAccelerateResponse:
      properties:
        acceleratedAmount:
          description: The amount accelerated.
          format: float
          type: number
      type: object
    LoanActivate:
      properties:
        amortizationAtActivation:
          description: >
            Instructions on how to activate a loan in `originated` status. The
            loan status

            changes to `active` after a successful activation.


            `expectedPaymentsAtOrigination` - we will use the exact
            `atOrigination.expectedPayments`

            due dates and amounts. The loan is not re-amortized.


            `amortizeAtActivation` - we will re-amortize the loan using today's
            date as the loan start date.

            `atOrigination.paymentFrequency` and `atOrigination.specificDays`
            are used to create due dates.

            `atOrigination.expectedPayments` due dates and amounts are not used.
          enum:
            - expectedPaymentsAtOrigination
            - amortizeAtActivation
          type: string
        sendNotice:
          default: true
          description: >-
            When set to `false`, the system will NOT send a `loanDetails` notice
            to the borrower.
          type: boolean
      type: object
    ExpectedPayment:
      properties:
        amount:
          description: The amount of the expected payment.
          format: float
          type: number
        date:
          description: The due date of the expected payment.
          format: date
          type: string
        dynamicFeeDetails:
          description: >
            When `paymentType`=`dynamicFee` this will contain details of the
            dynamic fee.
          properties:
            apiName:
              description: >
                The API name of the dynamic fee. For example: 'lateFee' or
                'breatherFee'.
              type: string
            displayName:
              description: >
                The display name of the dynamic fee as shown to the borrower in
                the UI. For example: `Late Fee` or `Breather Fee`.
              type: string
            dynamicFeeTypeId:
              description: The dynamic fee type identifier in the system.
              type: string
            loanFeeId:
              description: The loan fee identifier in the system.
              type: string
          type: object
        interestAmount:
          description: |
            The portion of the `amount` allocated to net interest.
            Available only for `paymentType=periodicPayment`.
          format: float
          type: number
        interestBeforeDiscountAmount:
          description: >
            The interest amount that was accrued before promo rate(s) or any
            discount.

            Available only for `paymentType=periodicPayment`.
          format: float
          type: number
        isDeferred:
          description: >
            `true` if the amount of this expected payment has been deferred
            before.
          readOnly: true
          type: boolean
        isForcedAmount:
          description: >
            Only applicable to `paymentType=periodicPayment`.

            If set to `true`, the system will honor the amount and will not
            update it on loan recalculations.

            If set to `false` and the amount is less than the
            `periodicPaymentAmount`, the system can increase the amount when

            the loan is being recalculated.

            In most of the cases, the lender should set the value to `false`
            (aka the default value.) If you need more

            explanation or advice on your use case, please contact the Peach
            team.
          readOnly: true
          type: boolean
        originalAmount:
          description: >
            The amount of the expected payment at creation. The `amount` will
            change as a result of refreshing

            expected payments, but the `originalAmount` will stay the same.
          format: float
          type: number
        paymentType:
          description: The payment type.
          enum:
            - periodicPayment
            - originationFee
            - drawFee
            - dynamicFee
            - downPayment
            - discountCredit
          type: string
        periodId:
          description: The period identifier.
          type: string
        principalAmount:
          description: |
            The portion of the `amount` allocated to principal.
            Available only for `paymentType=periodicPayment`.
          format: float
          type: number
        status:
          description: >
            The status of the expected payment.


            `scheduled`  - borrower is expected to make the payment. Only
            applicable to paymentType=dynamicFee.


            `booked` - borrower is or was expected to make the payment.


            `modified` - the amount was modified at some point and different
            from the original amount.


            `canceled` - borrower is or was not expected to make the payment.
          enum:
            - booked
            - modified
            - canceled
          type: string
        unroundedInterestAmount:
          description: >
            The portion of the `amount` allocated to net interest. Available
            only for `paymentType=periodicPayment`.

            This value is unrounded.
          nullable: true
          type: string
        unroundedInterestBeforeDiscountAmount:
          description: >
            The interest amount that was accrued before promo rate(s) or any
            discount. Available only for

            `paymentType=periodicPayment`. This value is unrounded.
          nullable: true
          type: string
        unroundedPrincipalAmount:
          description: >
            The portion of the `amount` allocated to principal. Available only
            for `paymentType=periodicPayment`.

            This value is unrounded.
          nullable: true
          type: string
      type: object
    LoanSchedule:
      properties:
        schedule:
          items:
            $ref: '#/components/schemas/ExpectedPayment'
          type: array
      type: object
    LoanActivationResponse:
      oneOf:
        - properties:
            amountsValidation:
              $ref: '#/components/schemas/AmountsValidation'
            ratesValidation:
              $ref: '#/components/schemas/RatesValidation'
            schedule:
              $ref: '#/components/schemas/LoanSchedule'
          title: Installment
          type: object
        - properties:
            amountsValidation:
              $ref: '#/components/schemas/AmountsValidation'
            schedule:
              $ref: '#/components/schemas/LoanSchedule'
          title: Line of Credit
          type: object
    AutopayExpectedPayment:
      properties:
        amount:
          description: The amount of the expected payment.
          format: float
          type: number
        date:
          description: The due date of the expected payment.
          format: date
          type: string
        dynamicFeeDetails:
          description: >
            When `paymentType`=`dynamicFee` this will contain details of the
            dynamic fee.
          properties:
            apiName:
              description: >
                The API name of the dynamic fee. For example: 'lateFee' or
                'breatherFee'.
              type: string
            displayName:
              description: >
                The display name of the dynamic fee as shown to the borrower in
                the UI. For example: `Late Fee` or `Breather Fee`.
              type: string
            dynamicFeeTypeId:
              description: The dynamic fee type identifier in the system.
              type: string
            loanFeeId:
              description: The loan fee identifier in the system.
              type: string
          type: object
        interestAmount:
          description: |
            The portion of the `amount` allocated to net interest.
            Available only for `paymentType=periodicPayment`.
          format: float
          type: number
        interestBeforeDiscountAmount:
          description: >
            The interest amount that was accrued before promo rate(s) or any
            discount.

            Available only for `paymentType=periodicPayment`.
          format: float
          type: number
        isDeferred:
          description: >
            `true` if the amount of this expected payment has been deferred
            before.
          readOnly: true
          type: boolean
        originalAmount:
          description: >
            The amount of the expected payment at creation. The `amount` will
            change as a result of refreshing

            expected payments, but the `originalAmount` will stay the same.
          format: float
          type: number
        paymentType:
          description: The payment type.
          enum:
            - periodicPayment
            - originationFee
            - drawFee
            - dynamicFee
            - downPayment
            - discountCredit
          type: string
        periodId:
          description: The period identifier.
          type: string
        principalAmount:
          description: |
            The portion of the `amount` allocated to principal.
            Available only for `paymentType=periodicPayment`.
          format: float
          type: number
        status:
          description: >
            The status of the expected payment.


            `booked` - borrower is or was expected to make the payment.


            `modified` - the amount was modified at some point and different
            from the original amount.


            `canceled` - borrower is or was not expected to make the payment.


            `processed` - a payment has been scheduled for this expected
            payment.
          enum:
            - booked
            - modified
            - canceled
            - processed
          type: string
      type: object
    InstallmentAutopay:
      allOf:
        - $ref: '#/components/schemas/IsLocked'
        - properties:
            agreementDocumentId:
              description: >
                The document descriptor ID corresponding to the autopay
                agreement document.
              type: string
            cancelReason:
              $ref: '#/components/schemas/AutopayCancelReason'
            createdAt:
              format: date-time
              type: string
            id:
              description: The autopay identifier.
              readOnly: true
              type: string
            paymentFrequency:
              description: The Autopay payments frequency.
              enum:
                - weekly
                - everyTwoWeeks
                - twiceMonthly
                - monthly
              type: string
            paymentInstrumentId:
              description: >
                The payment instrument ID with which this autopay plan will be
                charged through.
              type: string
            schedule:
              items:
                $ref: '#/components/schemas/AutopayExpectedPayment'
              type: array
            specificDays:
              $ref: '#/components/schemas/SpecificDays'
          type: object
      title: Installment
    LineOfCreditAutopay:
      allOf:
        - $ref: '#/components/schemas/IsLocked'
        - properties:
            agreementDocumentId:
              description: >
                The document descriptor ID corresponding to the autopay
                agreement document.
              type: string
            cancelReason:
              description: Why the transaction was canceled.
              enum:
                - invalidPaymentMethod
                - paymentMethodRemoved
                - tooManyFailedAttempts
                - loanFrozen
                - loanAccelerated
                - loanChargedOff
                - loanPaidOff
                - canceledByUser
                - loanTermsChanged
              nullable: true
              type: string
            createdAt:
              format: date-time
              type: string
            extraAmount:
              description: >-
                The extra amount that the borrower agrees to pay if
                `type=statementMinimumAmountPlusExtra`.
              format: float
              type: number
            id:
              description: The autopay identifier.
              readOnly: true
              type: string
            isAlignedToDueDates:
              description: >
                `true` - the Autopay transactions will be processed on the
                loan's due dates.


                `false` - the Autopay transactions schedule will be different
                from the loan's due dates schedule.


                If `isAlignedToDueDates=false` then `paymentFrequency` and
                `specificDays` must be provided.
              type: boolean
            offsetFromDueDate:
              items:
                type: integer
              nullable: true
              type: array
            paymentFrequency:
              description: >-
                The Autopay payments frequency. `Weekly` frequency is not
                supported for line of credit.
              enum:
                - twiceMonthly
                - everyTwoWeeks
                - monthly
              type: string
            paymentInstrumentId:
              description: >
                The payment instrument ID with which this autopay plan will be
                charged through.
              type: string
            schedule:
              items:
                $ref: '#/components/schemas/AutopayExpectedPayment'
              type: array
            specificDays:
              $ref: '#/components/schemas/SpecificDays'
            type:
              description: >
                Indicates how Autopay amount will be calculated for each closed
                statement.


                `statementMinimumAmount` - an Autopay will debit the statement
                minimum amount for the period.


                `statementMinimumAmountPlusExtra` - an Autopay will debit the
                statement minimum amount for the period plus

                extra amount. The extra amount is typically applied to
                principal. This is ONLY applicable to non-amortized

                line of credit loans.


                `statementBalanceAmount` - an Autopay transaction will debit the
                statement balance for the period. This is ONLY applicable to
                non-amortized

                line of credit loans.
              enum:
                - statementMinimumAmount
                - statementMinimumAmountPlusExtra
                - statementBalanceAmount
              type: string
          type: object
      title: Line Of Credit
    Autopay:
      anyOf:
        - $ref: '#/components/schemas/InstallmentAutopay'
        - $ref: '#/components/schemas/LineOfCreditAutopay'
    AutopayUpdate:
      properties:
        agreementDocumentId:
          description: >
            The document ID for the signed autopay agreement. Required if
            `previewMode=false`.
          type: string
        caseId:
          description: |
            An identifier for an existing case.
          type: string
        paymentInstrumentId:
          description: >
            The payment instrument ID with which this autopay plan will be
            charged through.
          type: string
        sendNotice:
          default: true
          description: >-
            When set to `false`, the system will NOT send a
            `autopayPaymentMethodUpdated` notice to the borrower.
          type: boolean
      required:
        - paymentInstrumentId
        - agreementDocumentId
      type: object
    DeltaTerms:
      description: >
        The delta change in interest, fees, calendar days, and number of due
        dates. Only relevant for installment loans. For

        non installment loans, `deltaTerms` fields will be null.
      properties:
        deltaTerms:
          properties:
            deltaDueDatesNumber:
              description: >
                A positive number indicates the number of additional due dates
                that were added to the loan schedule. A negative

                number indicates the number due dates that were removed from the
                loan schedule.
              nullable: true
              type: integer
            deltaDurationDays:
              description: >
                A positive number indicates number of calendar days that the
                loan's term is extended as a result of the

                change. A negative number indicates the number of calendar days
                that the loan's term is shortened as

                a result of the change.
              nullable: true
              type: integer
            deltaFeeAmount:
              description: >
                A positive amount indicates the additional fees that the
                borrower is expected to pay as a result of

                the change. A negative amount indicates savings in fees the
                borrower is expected to benefit from as

                a result of the change.
              format: float
              nullable: true
              type: number
            deltaInterestAmount:
              description: >
                A positive amount indicates the additional interest that the
                borrower is expected to pay as a

                result of the change. A negative amount indicates savings in
                interest the borrower is expected to

                benefit from as a result of the change.
              format: float
              nullable: true
              type: number
          type: object
      type: object
    InstallmentAutopayPost:
      properties:
        agreementDocumentId:
          description: >
            The document ID for the signed autopay agreement. Required if
            `previewMode=false`.
          type: string
        caseId:
          description: |
            An identifier for an existing case.
          type: string
        isAlignedToDueDates:
          description: >
            `true` - the Autopay payments will be aligned and processed on the
            loan's due dates.


            `false` - the Autopay payments schedule will be different from the
            loan's due dates schedule.


            If `isAlignedToDueDates=false` then `paymentFrequency` and
            `specificDays` must be provided.


            If the frequency and specific days of autopay matches the loan, we
            assume that it is `isAlignedToDueDates=true`.
          type: boolean
        paymentFrequency:
          description: The Autopay payments frequency.
          enum:
            - weekly
            - everyTwoWeeks
            - twiceMonthly
            - monthly
          type: string
        paymentInstrumentId:
          description: >
            The payment instrument ID with which this autopay plan will be
            charged through.
          type: string
        previewMode:
          default: false
          description: >-
            In `previewMode=true`, the loan doesn't change, and no changes are
            saved to the database.
          type: boolean
        sendNotice:
          default: true
          description: >-
            When set to `false`, the system will NOT send a `autopayEnabled`
            notice to the borrower.
          type: boolean
        specificDays:
          $ref: '#/components/schemas/SpecificDays'
      required:
        - paymentInstrumentId
      title: Installment
      type: object
    LineOfCreditAutopayPost:
      properties:
        agreementDocumentId:
          description: >
            The document ID for the signed autopay agreement. Required if
            `previewMode=false`.
          type: string
        amountType:
          default: statementMinimumAmount
          description: >
            Indicates how Autopay amount will be calculated for each closed
            statement.


            `statementMinimumAmount` - an Autopay will debit the statement
            minimum amount for the period. The statement minimum

            amount is defined as the sum of the expected payment amounts in the
            given period.


            `statementMinimumAmountPlusExtra` - an Autopay will debit the
            statement minimum amount for the period plus

            extra amount. The extra amount is typically applied to principal. In
            any given autopay period, if the

            'statementMinimumAmountPlusExtra' is greater than the outstanding
            balance on the line of credit, we only debit

            up to the amount of the latter.


            `statementBalanceAmount` - an Autopay transaction will debit the
            statement balance as of the statement creation

            date for the given period.
          enum:
            - statementMinimumAmount
            - statementMinimumAmountPlusExtra
            - statementBalanceAmount
          type: string
        caseId:
          description: |
            An identifier for an existing case.
          type: string
        extraAmount:
          description: >-
            The extra amount that the borrower agrees to pay if
            `type=statementMinimumAmountPlusExtra`.
          format: float
          type: number
        isAlignedToDueDates:
          description: >
            `true` - the Autopay transactions will be processed on the loan's
            due dates.


            `false` - the Autopay transactions schedule will be different from
            the loan's due dates schedule.

            If `isAlignedToDueDates=false` then `offsetFromDueDate` must be
            provided.
          type: boolean
        offsetFromDueDate:
          description: >
            Number of calendars days before due dates when Autopay payments are
            processed.

            If `isAlignedToDueDates` is false, it is required to specify the
            offset from the due dates. Depending on whether there are 1 or 2
            auto-payments

            per period, the array should include either 1 or 2 integers.

              - `onceAPeriod` - borrower can choose X days before the due date. Provide one number in a valid range between "1" and "statement to due date"
              days (e.g. 14 or 21). For example: `[5]` means the Autopay will be processed 5 calendar days before a given due date.
              - `twiceAPeriod` - borrower can choose two offsets, in other words, Autopay will process half the amount on the first Autopay date, and half
              the amount on the second Autopay date. Both days are "offsets", with "0" meaning on the due date. For example: `[5, 0]` means the first Autopay
              payment will be scheduled and processed 5 days before the due date, and the second Autopay payment will be scheduled and processed on the due date.
          items:
            type: integer
          nullable: true
          type: array
        paymentInstrumentId:
          description: >
            The payment instrument ID with which this autopay plan will be
            charged through.
          type: string
        previewMode:
          default: false
          description: >
            If `previewMode=true`, the loan doesn't change and no changes are
            saved to the database.
          type: boolean
        sendNotice:
          default: true
          description: >-
            When set to `false`, the system will NOT send a `autopayEnabled`
            notice to the borrower.
          type: boolean
      required:
        - paymentInstrumentId
      title: Line Of Credit
      type: object
    AutopayPost:
      anyOf:
        - $ref: '#/components/schemas/InstallmentAutopayPost'
        - $ref: '#/components/schemas/LineOfCreditAutopayPost'
    LoanCancelMetro2RequestBody:
      properties:
        accountStatusCode:
          default: DA
          description: >
            The Metro2 Account Status that will be reported to credit agencies
            upon loan cancellation or deletion. Make sure you follow the Metro2
            Credit Reporting Resource Guide.

            The following statuses were copied from the Metro2 Guide. The list
            below is a subset of account status codes.


            - `13` - Paid or closed account/zero balance. For Installment and
            Mortgage loans, the account should be paid with a zero Balance
            Amount. For Credit Line, Open and Revolving portfolio types, the
            account should no longer be available for use, and the Balance
            Amount should be zero. A Special Comment Code M or Compliance
            Condition Code XA may also be reported to indicate the account is
            closed.

            - `61` - Account paid in full, was a voluntary surrender. Requires
            Current Balance and Amount Past Due = zero.

            - `62` - Account paid in full, was a collection account. Requires
            Current Balance and Amount Past Due = zero.

            - `63` - Account paid in full, was a repossession. Requires Current
            Balance and Amount Past Due = zero.

            - `93` - Account assigned to internal or external collections.

            - `95` - Voluntary surrender; there may be a balance due.

            - `96` - Merchandise was repossessed; there may be a balance due.

            - `97` - Unpaid balance reported as a loss (charge-off).

            - `DA` - Delete entire account (for reasons other than fraud).

            - `DF` - Delete entire account due to confirmed fraud (fraud
            investigation completed).
          enum:
            - '13'
            - '61'
            - '62'
            - '63'
            - '93'
            - '95'
            - '96'
            - '97'
            - DA
            - DF
          type: string
      type: object
    LoanCancel:
      allOf:
        - properties:
            cancellationReason:
              $ref: '#/components/schemas/CancellationReason'
            metro2:
              $ref: '#/components/schemas/LoanCancelMetro2RequestBody'
            sendCancellationNotice:
              default: false
              description: >
                When set to `true`, the system will send `loanCanceled` notice
                to the borrower.
              type: boolean
          type: object
        - $ref: '#/components/schemas/CaseId'
    CardBaseData:
      allOf:
        - $ref: '#/components/schemas/BaseWithExternalIdMixin'
        - properties:
            externalId:
              description: >-
                A lender's unique identifier for a specific promotional program
                type.
              type: string
            galileoCad:
              description: |
                Galileo-generated identifier for a specific card.
              type: string
            galileoPrn:
              description: |
                Unique 12-digit Galileo-generated account identifier.
              type: string
            isExternal:
              default: true
              description: >
                When `true` (default), Peach does not interact with the card
                directly; the object is for

                visualization/filter purposes only. When `false`, Peach will
                call out to / receive events

                from the external card system (e.g. Lithic) and `issuerId` plus
                the issuer-specific card

                token field (e.g. `marqetaCardToken`, `lithicCardToken`, or
                `galileoCad`) are required.
              type: boolean
            issuerId:
              description: >-
                The card issuer/vendor unique identifier. The card issuer must
                be configured in Peach.
              type: string
            lithicAccountToken:
              description: >
                Lithic-generated identifier for an account holder (consumer or
                business).
              type: string
            lithicCardToken:
              description: |
                Lithic-generated identifier for a specific card product.
              type: string
            marqetaBusinessToken:
              description: |
                Marqeta-generated identifier for a specific business.
              type: string
            marqetaCardProductToken:
              description: |
                Marqeta-generated identifier for a specific card product.
              type: string
            marqetaCardToken:
              description: |
                Lender or Marqeta-generated unique identifier for the card.
              type: string
            marqetaUserToken:
              description: |
                Marqeta-generated identifier for a specific user.
              type: string
            status:
              default: active
              description: >
                The lender-owned status of the card. Peach does not auto-update
                this field

                from issuer webhooks. Defaults to `active` on creation if not
                provided.

                This is separate from `cardDetails.status` which reflects the
                issuer-driven

                internal status.
              enum:
                - active
                - inactive
                - blocked
                - closed
                - expired
              type: string
          type: object
    CardDetails:
      description: >-
        The card details. The `status` field here reflects the issuer-driven
        internal status. Prefer the top-level `status` field for the
        lender-owned status.
      properties:
        address:
          $ref: '#/components/schemas/Address'
          description: >-
            The billing address associated with the card. Must have at least
            postal code.
        cardNumberLastFour:
          description: The last four digits of the card number.
          type: string
        expirationMonth:
          description: The expiration month of the card.
          example: 12
          maximum: 12
          minimum: 1
          type: integer
        expirationYear:
          description: The expiration year of the card.
          example: 2025
          type: integer
        firstName:
          description: First name on the card.
          type: string
        fulfillmentStatus:
          description: The fulfillment status of the card.
          enum:
            - issued
            - ordered
            - rejected
            - shipped
            - digitallyPresented
          type: string
        lastName:
          description: Last name on the card.
          type: string
        network:
          description: The card network.
          enum:
            - visa
            - mastercard
            - discover
            - americanExpress
          type: string
        nickname:
          description: Nickname for card, typically decided by consumer
          nullable: true
          type: string
        status:
          description: The issuer-driven internal status of the card.
          enum:
            - inactive
            - pendingActivation
            - pendingFulfillment
            - active
            - paused
            - suspended
            - terminated
            - canceled
            - expired
            - invalid
          type: string
        usageType:
          description: The type of allowable usage for the card.
          enum:
            - singleUse
            - merchantLocked
            - digitalWallet
            - unlocked
            - physical
          type: string
      type: object
    BaseCard:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - $ref: '#/components/schemas/CardBaseData'
        - properties:
            cardDetails:
              $ref: '#/components/schemas/CardDetails'
          type: object
      title: Card
    VirtualCardProperties:
      properties:
        cardBalances:
          description: >-
            The card balances. Only applicable to `virtualCard` type card
            objects.
          properties:
            originalAmount:
              description: >
                The original amount of the card before it was used. If null,
                will default to the loan's `atOrigination.amountFinanced`.
              format: float
              nullable: true
              type: number
            refundedAmount:
              description: >
                The amount of the card that was refunded back to the card or
                otherwise not used.
              format: float
              nullable: true
              readOnly: true
              type: number
            usedAmount:
              description: |
                The amount of the card that was used.
              format: float
              nullable: true
              readOnly: true
              type: number
          type: object
        type:
          description: >
            The type of card issued. For loanType `installment`, only the only
            allowable value is virtualCard.

            For loanType `lineOfCredit`, virtual and credit card are accepted.
          enum:
            - virtualCard
          type: string
      type: object
    VirtualCard:
      allOf:
        - $ref: '#/components/schemas/BaseCard'
        - $ref: '#/components/schemas/VirtualCardProperties'
      title: Virtual card
    CreditCardProperties:
      properties:
        type:
          description: >
            The type of card issued. For loanType `installment`, only the only
            allowable value is virtualCard.

            For loanType `lineOfCredit`, virtual and credit card are accepted.
          enum:
            - creditCard
          type: string
        usageRestrictions:
          allOf:
            - description: >
                Additional usage restrictions of the specific card to apply to
                purchases. These will be applied in addition to
                `usageRestrictions` created in the program object as part of the
                card issuer APIs.
            - $ref: '#/components/schemas/UsageRestrictions'
      type: object
    CreditCard:
      allOf:
        - $ref: '#/components/schemas/BaseCard'
        - $ref: '#/components/schemas/CreditCardProperties'
      title: Credit card
    Card:
      anyOf:
        - $ref: '#/components/schemas/VirtualCard'
        - $ref: '#/components/schemas/CreditCard'
    CardDetailsWithPanAndCvv:
      allOf:
        - $ref: '#/components/schemas/CardDetails'
        - properties:
            cvvNumber:
              description: >-
                The full CVV2 number. Only included in the `GET` endpoint when
                `showCvv=true`.
              readOnly: true
              type: string
            pan:
              description: >-
                The card full PAN. Only included in the `GET` endpoint when
                `showPan=true`.
              type: string
          type: object
    BaseCardWithPanAndCvv:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - $ref: '#/components/schemas/CardBaseData'
        - properties:
            cardDetails:
              $ref: '#/components/schemas/CardDetailsWithPanAndCvv'
          type: object
      title: Card
    VirtualCardWithPanAndCvv:
      allOf:
        - $ref: '#/components/schemas/BaseCardWithPanAndCvv'
        - $ref: '#/components/schemas/VirtualCardProperties'
      title: Virtual card
    CreditCardWithPanAndCvv:
      allOf:
        - $ref: '#/components/schemas/BaseCardWithPanAndCvv'
        - $ref: '#/components/schemas/CreditCardProperties'
      title: Credit card
    CardWithPanAndCvv:
      anyOf:
        - $ref: '#/components/schemas/VirtualCardWithPanAndCvv'
        - $ref: '#/components/schemas/CreditCardWithPanAndCvv'
    CardStatusChangeReasonCode:
      properties:
        statusChangeReasonCode:
          description: >
            The reason a card's status is being updated. Please see table below
            for allowable statuses based on reason code.


            | Peach Card Status Change Reason Code | Allowable Peach Card Status
            |

            |---------------------------------------|-----------------------------|

            | cardCanceled                          |
            canceled                    |

            | cardExpired                           |
            expired                     |

            | cardInvalid                           |
            invalid                     |

            | cardClosed                            |
            terminated                  |

            | cardDamaged                           |
            terminated                  |

            | cardFraudulent                        |
            paused                      |

            | cardInactive                          |
            inactive                    |

            | cardLost                              |
            paused                      |

            | cardPFraud                            |
            paused                      |

            | cardSuspended                         |
            suspended                   |

            | cardUnauthorized                      |
            invalid                     |

            | cardAcceptorActivityQuestionable      |
            paused                      |

            | cardStolen                            |
            terminated                  |
          enum:
            - cardCanceled
            - cardExpired
            - cardInvalid
            - cardClosed
            - cardDamaged
            - cardFraudulent
            - cardInactive
            - cardLost
            - cardPFraud
            - cardSuspended
            - cardUnauthorized
            - cardAcceptorActivityQuestionable
            - cardStolen
          type: string
      type: object
    PutCardWithPanAndCvv:
      anyOf:
        - allOf:
            - $ref: '#/components/schemas/VirtualCardWithPanAndCvv'
            - $ref: '#/components/schemas/CardStatusChangeReasonCode'
          title: Virtual card
        - allOf:
            - $ref: '#/components/schemas/CreditCardWithPanAndCvv'
            - $ref: '#/components/schemas/CardStatusChangeReasonCode'
          title: Credit card
    LoanChargeOff:
      allOf:
        - properties:
            chargedOffReason:
              description: >
                The reason for loan charge off:


                `term` means the loan was charged off per loan type
                configuration after X days overdue.


                `fraudulent` means the loan was charged off for fraudulent
                reason. If the loan is reported to one or more credit bureaus,
                the system will automatically send a special request to each
                bureau to delete the tradeline due to confirmed fraud. This is
                the only reason that the system will automatically trigger a
                request to delete the tradeline. For other reasons, if you need
                to delete the tradeline please call the `Delete from credit
                reporting` endpoint or use an agent tool.


                `bankruptcy` means the loan was charged off because of
                bankruptcy.


                `legal` means the loan was charged off because of some legal
                reason.
              enum:
                - term
                - fraudulent
                - bankruptcy
                - legal
              type: string
            effectiveDate:
              description: >
                The effective date of the loan charge-off. The date should be
                the current date in the product timezone.

                Passing in `"today"` will also set the field to today's date.
              format: date
              type: string
            sendNotice:
              default: true
              description: >
                Only applicable to `chargedOffReason=term`. If
                `chargedOffReason` is one of the following reasons [fraudulent,
                bankruptcy, legal], the system will ignore the `sendNotice`
                value and will NOT send the `loanChargedOffUnsecured` notice.


                If `chargedOffReason=term` and the passed value is `false`, the
                system will NOT send the `loanChargedOffUnsecured` notice to the
                borrower.
              type: boolean
          type: object
        - $ref: '#/components/schemas/CaseId'
      required:
        - effectiveDate
        - chargedOffReason
    LoanChargeOffResponse:
      properties:
        chargeOffAmount:
          description: The amount charged-off.
          format: float
          type: number
      type: object
    CollectionAgencyLoanDetailsBase:
      properties:
        agencyExternalId:
          description: The lender's external identifier for the agency.
          readOnly: true
          type: string
        assignedOnDate:
          description: >
            The date when the loan was assigned to a debt collection agency. If
            a date is not passed, the system will set the date to today.
          format: date
          nullable: true
          type: string
        assignmentType:
          description: |
            The type of loan assignment to a debt collection agency.

            `wholeSale` - The loan was sold to a third party debt collections
            agency. The loan is no longer managed by Peach as the system of
            record.

            `contingency` - Collection efforts are performed by a third party
            debt collections agency. The loan is still managed by Peach as the
            system of record.
          enum:
            - wholeSale
            - contingency
          nullable: false
          type: string
        metro2:
          properties:
            reportK2Segment:
              default: false
              description: |
                Only applicable to loans that are reported to credit bureaus.

                If `true`, the system will report the K2 segment in the Metro2
                file to indicate that the loan has been sold to a third party
                debt collections agency. The Peach system will report the loan
                for the final time in the period the loan is assigned to the
                collections agency. After that, Peach will not report the loan
                again; it is the new collection agency's responsibility to
                handle all future reporting.

                If `false`, the system will not report the K2 segment in the
                Metro2 file. Peach will continue to report the loan.
              nullable: false
              type: boolean
          type: object
        status:
          description: >
            `pendingAssignment` - the loan is in the process of being assigned
            to an agency. It might take a few days for the agency to be ready to
            start collecting debt. Peach cannot collect payments.


            `assigned` - the loan was successfully assigned to an agency. The
            borrower should contact the agency for details. Peach cannot collect
            payments and loan balances might not be accurate.
          enum:
            - unassigned
            - pendingAssignment
            - assigned
          type: string
      type: object
    CollectionAgencyLoanDetailsGet:
      allOf:
        - properties:
            agencyId:
              description: |
                The agency's unique identifier.
              readOnly: true
              type: string
          type: object
        - $ref: '#/components/schemas/CollectionAgencyLoanDetailsBase'
    CollectionAgencyLoanDetailsPut:
      allOf:
        - properties:
            agencyId:
              $ref: '#/components/schemas/AnyId'
              description: |
                The agency's unique identifier, internal or lender's external.
              writeOnly: true
          type: object
        - $ref: '#/components/schemas/CollectionAgencyLoanDetailsBase'
    CreditLimitProperties:
      allOf:
        - properties:
            adverseActionReason:
              description: >
                The reason why the credit limit was changed. If passed, the copy
                used in the `locCreditLimitChanged` communication

                template. Make sure to phrase the copy as a full sentence or
                paragraph.
              type: string
            creditLimitAmount:
              description: >
                The credit limit amount for the line or draw. Only applicable to
                line of credit or installment loan with multiple

                advances. For installment loans with multi-advances, it is the
                amount financed set at origination.
              format: float
              type: number
            sendNotice:
              default: true
              description: >
                Whether the system sent `locCreditLimitChanged` notice to the
                borrower.
              type: boolean
          required:
            - creditLimitAmount
          type: object
        - $ref: '#/components/schemas/CaseId'
    CreditReportingStatusBase:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            accountStatusCode:
              description: >
                The metro2 account status code. This is a 2 digit code that
                indicates the status of the account.

                This is given by the lender in either in loan cancelation or
                opting a loan out of credit reporting.
              readOnly: true
              type: string
            loanId:
              description: The unique loan identifier.
              readOnly: true
              type: string
          type: object
    StartCreditReporting:
      allOf:
        - $ref: '#/components/schemas/CreditReportingStatusBase'
        - properties:
            creditAgencyId:
              description: The unique credit agency identifier.
              type: string
            reportingStartDate:
              description: >
                When a new loan is created the system automatically starts
                reporting to all agencies that are configured in the loan type
                configuration. In that case the `reportingStartDate` will be
                equal to the loan's `activatedAt` date.


                When an existing loans (aka loan in flight) needs to be
                reported, the `reportingStartDate` indicates how much of the
                loan's history should be reported. If a full history needs to be
                reported, set the `reportingStartDate` to be equal to loan's
                `activatedAt` date.
              format: date
              type: string
          type: object
    DeleteCreditReporting:
      allOf:
        - $ref: '#/components/schemas/CreditReportingStatusBase'
        - properties:
            caseId:
              description: An identifier for an existing case.
              nullable: true
              type: string
              writeOnly: true
            deletedReason:
              description: |
                The reason why the loan was stopped from being reported.
              enum:
                - legal
                - fcraDispute
                - loanDataCorrupted
                - fraudulent
                - other
              type: string
            deletedReasonDetails:
              description: >
                Additional details about why the loan was stopped from being
                reported.
              type: string
            metro2:
              $ref: '#/components/schemas/LoanCancelMetro2RequestBody'
            reportingEndDate:
              description: >
                This attribute has a value (date) if the loan needs to be
                deleted or was already deleted from being reported to the credit
                agency.


                Once the loan is deleted, it cannot be reported again.
              format: date
              readOnly: true
              type: string
          type: object
    CreditReportingStatus:
      allOf:
        - $ref: '#/components/schemas/StartCreditReporting'
        - $ref: '#/components/schemas/DeleteCreditReporting'
      title: Credit Reporting Status
    LoanCreditReportingFields:
      properties:
        metro2:
          properties:
            complianceConditionCode:
              description: >
                Compliance condition code that if set will be reported to credit
                agencies. This value will override any other value currently
                reported in the Special Comment field in the Base Segment.

                The system will reset the value to "empty" after it is used in
                the upcoming credit reporting.
              maxLength: 2
              type: string
            ecoaCodeBaseSegment:
              description: >
                ECOA code that if set will be reported to credit agencies. This
                value will override any other value currently reported in the
                ECOA Code field in Base Segment.

                The system will reset the value to "empty" after it is used in
                the upcoming credit reporting.
              maxLength: 1
              type: string
            specialCommentBaseSegment:
              description: >
                Special comment code that if set will be reported to credit
                agencies. This value will override any other value currently
                reported in the Special Comment field in the Base Segment.

                The system will reset the value to "empty" after it is used in
                the upcoming credit reporting.
              maxLength: 2
              type: string
          type: object
      type: object
    customPaymentPlanAmount:
      description: >
        Amount required to be fulfilled for each payment plan period. The
        `amount` provided should be the recurring amount rather than the total
        amount

        of the plan. Peach's system will use the amount provided to determine
        whether the borrower is past due and report to bureaus accordingly (if
        applicable).

        Note: Any fees added during the duration of the payment plan must also
        be paid in order for the borrower to remain "current".


        `amount` can be higher or lower than the borrower's originally
        contracted amount. Peach's system will revert to the recurring amount
        after the payment

        plan end date if the loan still has a balance at the end of the payment
        plan.


        Do not pass this attribute if the payment plan type is
        `interestAndFees`.
      format: float
      type: number
    customPaymentPlanCancellationReason:
      description: |
        The cancellation reason:

        `canceledByUser` - payment plan was canceled by an agent or borrower.

        `loanTermsChanged` - loan terms changed.

        `loanChargedOff` - loan was charged off.

        `loanAccelerated` - loan was accelerated.

        `otherPaymentPlanOffered` - another payment plan was offered.

        `other` - for any other reason requiring cancellation.
      enum:
        - canceledByUser
        - loanTermsChanged
        - loanChargedOff
        - loanAccelerated
        - otherPaymentPlanOffered
        - other
      type: string
    customPaymentPlanExternalId:
      description: >
        A lender's identifier for a payment pay plan.


        After the object is successfully created, a lender can use ID or
        externalId identifiers to fetch the object.


        To fetch the object using externalId you need to add `ext-` to the URL.


        Note: Don't add ext- to the identifier value. For example: if the
        external identifier is `ABCDE`, then pass externalId=ACBCE

        and NOT ext-ABCDE when creating the object.
      type: string
    customPaymentPlanIsExtendLoanDuration:
      default: true
      description: >
        If `true`, the system may adjust and increase the loan `duration` beyond
        the current end date to accommodate the payment plan. If `false`, the

        system will not add additional periods beyond the current loan
        `duration`.
      type: boolean
    customPaymentPlanNumberOfPeriods:
      description: >
        The number of periods during which the payment plan terms are effective.
        Represented as the number of `paymentFrequency` periods. The system will

        begin counting the `numberOfPeriods` from the period represented by the
        `selectedDueDate`.


        The `numberOfPeriods` of the payment plan must take place within the
        existing loan duration. Moreover, if `isExtendLoanDuration` is `true`,

        the `numberOfPeriods` must end on or before the last period of the loan.
        If `isExtendLoanDuration` is `false`, then `numberOfPeriods` for the
        payment

        plan must end on or before the second to last payment.


        For example, if the payment plan `frequency=weekly` and
        `numberOfPeriods=6` and the remaining loan duration is 12, the payment
        plan will be created with a

        6 weeks duration during which the designated payment plan `amount` is in
        effect. Any subsequent periods after the payment plan has ended will
        revert

        to the original periodic payment amount.
      type: integer
    customPaymentPlanType:
      default: fixedAmountAndFees
      description: >
        Determines how the system will calculate payment plan payments during
        the payment plan's `numberOfPeriods`.


        `fixedAmountAndFees` - the payment plan payment amounts will be set as a
        recurring `amount`. Note that any configured recurring

        fees (e.g. service fees) will also be included in the payment plan
        amount unless explicitly canceled. `amount` must be passed at

        the time of payment plan creation when using this option.


        `interestAndFees` - the payment plan amounts will be calculated by
        Peach's system as "interest only". Note that any configured

        recurring fees (e.g. service fees) will also be included in the payment
        plan amount unless explicitly canceled. Do not pass `amount`

        when using this option.
      enum:
        - fixedAmountAndFees
        - interestAndFees
      type: string
    customPaymentPlanReasonDetails:
      description: >
        The reason for payment plan cancellation. This is typically entered by
        an agent canceling a payment plan via the front end.
      type: string
    customPaymentPlanSelectedDueDate:
      description: >
        The due date of the period from which to begin the payment plan. If
        `selectedDueDate` is not provided upon payment plan creation,

        the system will use the current period due date as the
        `selectedDueDate`. If `selectedDueDate` is provided, it must be for a
        due date in the future.
      format: date
      type: string
    CustomPaymentPlanResult:
      allOf:
        - properties:
            amount:
              $ref: '#/components/schemas/customPaymentPlanAmount'
            canceledBy:
              description: Identifier of the `User` who canceled the payment plan.
              type: string
            cancellationCaseId:
              description: An identifier for an existing case.
              type: string
            cancellationReason:
              $ref: '#/components/schemas/customPaymentPlanCancellationReason'
            createdBy:
              description: |
                Identifier of the `User` who created the payment plan.
              type: string
            creationCaseId:
              description: An identifier for an existing case.
              type: string
            externalId:
              $ref: '#/components/schemas/customPaymentPlanExternalId'
            id:
              readOnly: true
              type: string
            isExtendLoanDuration:
              $ref: '#/components/schemas/customPaymentPlanIsExtendLoanDuration'
            numberOfPeriods:
              $ref: '#/components/schemas/customPaymentPlanNumberOfPeriods'
            paymentPlanType:
              $ref: '#/components/schemas/customPaymentPlanType'
            reasonDetails:
              $ref: '#/components/schemas/customPaymentPlanReasonDetails'
            schedule:
              items:
                $ref: '#/components/schemas/ExpectedPayment'
              type: array
            selectedDueDate:
              $ref: '#/components/schemas/customPaymentPlanSelectedDueDate'
            status:
              description: >
                The payment plan status. Once a payment plan is created, it is,
                by definition, `active`. Once all

                periods in a payment plan period have passed, it will change
                status to `inactive`. If a payment plan

                is canceled, it will change status to `canceled`.
              enum:
                - active
                - inactive
                - canceled
              type: string
            timestamps:
              properties:
                canceledAt:
                  format: date-time
                  readOnly: true
                  type: string
                createdAt:
                  format: date-time
                  readOnly: true
                  type: string
              readOnly: true
              type: object
          type: object
    SendNoticeCancelAutopay:
      default: true
      description: >
        When set to `false`, the system will NOT send a
        `loanPaymentScheduleChanged` notice to the borrower.


        Note: Changing the loan terms will automatically cancel an existing
        Autopay (if enabled). A borrower,  an agent or

        API caller needs to turn on / enable a new Autopay plan after the loan
        terms change is completed. If the loan has Autopay enabled:
         - When `sendNotice=false`, the system will NOT send an `autopayCanceledBySystem` notice.
         - When `sendNotice=true`, the system will send an `autopayCanceledBySystem` notice in addition to the applicable loan terms notice.
      type: boolean
    LoanCustomPaymentPlan:
      properties:
        amount:
          $ref: '#/components/schemas/customPaymentPlanAmount'
        caseId:
          description: An identifier for an existing case.
          type: string
        externalId:
          $ref: '#/components/schemas/customPaymentPlanExternalId'
        isExtendLoanDuration:
          $ref: '#/components/schemas/customPaymentPlanIsExtendLoanDuration'
        numberOfPeriods:
          $ref: '#/components/schemas/customPaymentPlanNumberOfPeriods'
        paymentPlanType:
          $ref: '#/components/schemas/customPaymentPlanType'
        previewMode:
          default: false
          description: >-
            In `previewMode=true`, the loan doesn't change, and no changes are
            saved to the database.
          type: boolean
        selectedDueDate:
          $ref: '#/components/schemas/customPaymentPlanSelectedDueDate'
        sendNotice:
          $ref: '#/components/schemas/SendNoticeCancelAutopay'
      required:
        - numberOfPeriods
      type: object
    LoanCustomPaymentPlanCancel:
      properties:
        cancellationReason:
          $ref: '#/components/schemas/customPaymentPlanCancellationReason'
        caseId:
          description: An identifier for an existing case.
          type: string
        reasonDetails:
          $ref: '#/components/schemas/customPaymentPlanReasonDetails'
        sendNotice:
          default: false
          description: >
            When set to `false`, the system will NOT send a
            `loanPaymentScheduleChanged` notice to the borrower.
          type: boolean
      required:
        - cancellationReason
      type: object
    LoanDeferDueDate:
      allOf:
        - properties:
            addAfterLastDueDate:
              default: false
              description: >
                `true` to move the new due date to a date after the last due
                date. The date will be calculated

                based upon the existing loan cadence. The `newDueDate` field
                should be left empty if utilizing this option.
              type: boolean
            agreementDocumentId:
              description: >
                The document descriptor ID corresponding to the accepted loan
                term change agreement.
              type: string
            newDueDate:
              description: >
                The proposed new due date, chosen from an existing due date
                after the selected date. The

                `addAfterLastDueDate` field should be toggled to false if
                utilizing this option.
              format: date
              type: string
            previewMode:
              default: false
              description: >
                If `previewMode=true`, the loan doesn't change and no changes
                are saved to the database.
              type: boolean
            selectedDueDate:
              description: >
                The selected due date to defer. It can be the due date of the
                current period or a future due date in the loan schedule.
              format: date
              type: string
            sendNotice:
              $ref: '#/components/schemas/SendNoticeCancelAutopay'
            waiveFee:
              default: false
              description: >
                `true` to charge a fee for deferral of a due date. The fee
                amount is defined as part of the loan type.
              type: boolean
          type: object
        - $ref: '#/components/schemas/CaseId'
      required:
        - selectedDueDate
    DueDateDeferralFeeAmount:
      properties:
        dueDateDeferralFeeAmount:
          description: The due date deferral fee amount
          type: integer
      type: object
    LoanDeferSchedule:
      allOf:
        - properties:
            agreementDocumentId:
              description: >
                The document descriptor ID corresponding to the accepted loan
                term change agreement.
              type: string
            bufferToPushOutSchedule:
              description: >
                When deferring during the first period, this represents the
                number of calendar days that will be added to

                today's date. The resulting date will be used to push out due
                dates (today's date + buffer days). Interest

                will continue to accrue.


                When deferring after the first period, we defer all due dates
                that fall between "today's date"

                and "today's date + buffer days" to the end of the loan one by
                one. If the current date falls on a due date,

                it will not be deferred as the period has ended.
              nullable: true
              type: integer
            previewMode:
              default: false
              description: >
                If `previewMode=true`, the loan doesn't change and no changes
                are saved to the database.
              type: boolean
            sendNotice:
              $ref: '#/components/schemas/SendNoticeCancelAutopay'
            waiveFee:
              default: false
              description: >
                `true` to charge a deferral fee. The fee amount is defined as
                part of the loan type.
              type: boolean
          type: object
        - $ref: '#/components/schemas/CaseId'
      required:
        - bufferToPushOutSchedule
    CreditLimitPercentage:
      description: >
        The draw's credit limit as a percentage of the loan's credit limit.
        Lenders can set and update `creditLimitAmount`,

        `creditLimitPercentage`, or both. If both values are set, the system
        will use the lower value. The format is decimal.

        For example, 0.01 is a 1%, 0.2 is a 20%.
      format: float
      type: number
    MinPaymentCalculation:
      description: >
        The logic to calculate the minimum payment amount when a statement is
        created.

        All interest accrued in the period and fees are always part of the
        minimum payment amount.


        If `includeOverLimitAmount` is set to `true`, the minimum payment amount
        will include the

        over limit amount at the time of statement generation as part of the
        required minimum payment.


        Using `percentageOfPrincipal`, lenders can also control what percentage
        of the outstanding principal

        will be added to the minimum amount.


        Statement logic adds up all draws calculated minimum payment amounts and
        sets the total as the statement

        minimum amount. If the `loanType.statement` object is configured such
        that `includeOverdueAmountInMinPayment`

        is set to `true`, the statement minimum payment amount will include the
        loan/line overdue amount as part of

        the required minimum payment on the statement.
      properties:
        includeOverLimitAmount:
          default: false
          description: >
            The system first calculates the draw minimum amount, which includes
            accrued interest,

            fees and some percentage of the outstanding principal.


            If `includeOverLimitAmount=true`, the system would add an over limit
            amount to the minimum amount.

            The over limit amount is calculated as `max(utilizationAmount -
            creditLimitAmount, 0)`

            at the time of statement generation.
          type: boolean
        minAmount:
          description: >
            The minimum periodic amount. For example: $15.00. The minimum will
            be only enforced if the draw doesn't have an amortized amount.

            The minimum will not be enforced if the principal of the draw is
            zero.


            Example:

            - Outstanding draw principal is $100.00.

            - `percentageOfPrincipal=0.01` (aka 1%).

            - Interest rate is 2% per month.

            - `minAmount=15`.

            - Interest amount per month is: $100.00 * 2% = $2.00.

            - Minimum amount is: $2 + $100.00 * 1% = $3.00.


            The minimum payment will be set to $15.00 and not $3.00. The split
            between principal and interest will be: `interest=$2.00` and

            `principal=$13.00`.
          format: float
          type: number
        minInterestChargeAmount:
          default: 0
          description: >
            The minimum amount of interest charged in a period. If the draw has
            accrued interest in a billing period, but the amount calculated

            is less than the `minInterestChargeAmount`, the system will add
            additional interest amount to the draw's interest bucket to equal

            the `minInterestChargeAmount`.
          format: float
          type: number
        percentageOfPrincipal:
          description: >
            Percentage of draw's outstanding principal and/or membership fee

            (if applicable).

            The range is 0-1.

            The format is decimal.

            For example, 0.01 is a 1%, 0.2 is a 20%.


            For non-amortized draw or amortized draws for which the amortization

            term expires, the system will use the `percentageOfPrincipal` to

            calculate the portion of principal and membership fee (if

            applicable) for minimum amount.


            For amortized draws within the amortization term, the system will
            use

            the `percentageOfPrincipal` to calculate membership fee only (if

            applicable) for minimum amount.

            The principal portion is taken from the expected payments (aka

            amortized amount).
          format: float
          maximum: 1
          minimum: 0
          type: number
      type: object
    RateCapsAtOriginationDraw:
      description: |
        Rate caps that should apply to the draw at origination. 

        1. When creating a new Draw:
          - If `atOrigination.rateCaps` is not provided or null, copy the Line of Credit's 
            rate caps (if they exist).
          - If `atOrigination.rateCaps` is provided, create the specified rate caps and 
            ignore the Line of Credit's existing rate caps.
          - If `atOrigination.rateCaps` is an empty list, neither copy nor create any rate caps
        2. After a Draw is created, it manages its own Rate Caps independently. 
           Any updates to the Line of Credit's Rate Caps will not affect the Draw, and vice versa.
      items:
        $ref: '#/components/schemas/RateCapAtOrigination'
      nullable: true
      title: Rate Caps At Origination
      type: array
    DrawAtOrigination:
      description: >
        This object contains loan details and terms as they were shown to a
        borrower at origination.
      properties:
        aprEffective:
          description: >
            The effective APR of the loan at origination. Pass both `aprNominal`
            and `aprEffective` even if they are equal.


            This field is deprecated for Line of Credit and Draw. You can still
            pass the value, and it will be stored on the object.

            However, it will not be used/displayed anywhere. The system will use
            the interest rate values of Line of Credit and Draws

            and show them as the APR (for example, on the statement.)
          format: float
          nullable: true
          type: number
        aprNominal:
          description: >
            The nominal APR of the loan at origination. Pass both `aprNominal`
            and `aprEffective` even if they are equal.


            This field is deprecated for Line of Credit and Draw. You can still
            pass the value, and it will be stored on the object.

            However, it will not be used/displayed anywhere. The system will use
            the interest rate values of Line of Credit and Draws

            and show them as the APR (for example, on the statement.)
          format: float
          nullable: true
          type: number
        autoAmortization:
          description: >
            Draws can be automatically amortized based on lender needs.
            Amortization of the draw allows borrowers to pay it back over a
            longer period

            of time. If the draw is not amortized, the minimum amount due will
            be calculated based on the `minPaymentCalculation` logic.


            The system will automatically amortize the draw only ONCE in the
            first period in which a purchase was ever made. If more purchases

            were made in the following periods, the system will NOT
            automatically re-amortize the draw. If you need to re-amortized the
            `draw` you should

            call the `Amortize draw` endpoint.


            Note:

            - If the loan type is configured to accrue interest as
            `accrualMethod=compoundWithFees`, there is a known limitation to the
            draw amortization

            calculation logic.

            - The draw amortization calculation will be done using the
            `compound` method and not `compoundWithFees`. To ensure that the
            system calculates

            interest accurately, amortized draws should NOT include any fees.
          properties:
            amortizationLogic:
              description: >
                - `amortizeAfterEachPurchase` - indicates whether the system
                needs to amortize and re-amortize the draw when a new purchase
                is posted over `duration`

                periods. If no new purchases were posted, the system will not
                re-amortize the draw.

                - `aggregatePurchasesInPeriod` - indicates whether new purchases
                during a period should be "aggregated", added to outstanding
                draw principal and amortized

                over `duration` periods automatically when the period ends. If
                no purchases were posted in a period, the system will not
                re-amortize the draw.
              enum:
                - amortizeAfterEachPurchase
                - aggregatePurchasesInPeriod
              type: string
            amortizationMethod:
              default: equalPayments
              description: >
                Loan amortization method.


                `equalPayments` - the system will amortize the loan or draw
                making recurring payments equal (except maybe for the last
                payment).

                Most installment loans are expected to use this method.


                `interestPaymentsBalloonPrincipal` - the system will amortize
                the loan or draw making recurring payments equal to interest
                only

                and the last payment will include the entire principal. Keep in
                mind that if you set
                `interest.periodAccrualDurationType=actual`,

                the recurring payment amounts will be different every period for
                monthly and twice monthly frequencies. This is because a month

                can have 28, 29, 30 or 31 days and interest accrued will vary
                based on the number of days in the month.


                There are additional limitations to be aware for
                `interestPaymentsBalloonPrincipal`. For installment loans,
                Autopay can only be

                aligned to due dates. It means that
                `autoPay.allowedFrequency.isDueDatesAvailable` must be set to
                `false`. This way the system

                will only allow Autopay to be aligned to the loan frequency and
                due dates.
              enum:
                - equalPayments
                - interestPaymentsBalloonPrincipal
                - custom
              readOnly: true
              type: string
            duration:
              description: >
                The duration of the draw as a number of `paymentFrequency`
                periods of the line of credit. Only applicable if the draw needs
                to be amortized. Pass one of the values

                only, `duration` or `periodicPaymentAmount`.
              type: integer
            periodicPaymentAmount:
              description: >-
                The recurring payment amount. The system will calculate the
                needed duration. Pass one of the values only, `duration` or
                `periodicPaymentAmount`.
              format: float
              type: number
          required:
            - amortizationLogic
          type: object
        creditLimitAmount:
          description: The credit limit.
          format: float
          type: number
        creditLimitPercentage:
          $ref: '#/components/schemas/CreditLimitPercentage'
        fees:
          description: The loan fees.
          properties:
            drawFeeAmount:
              description: >
                The amount of the draw fee. The draw fee will be due on a due
                date of the period the draw was activated.

                Pass only one of the following values, `drawFeeAmount` or
                `drawFeePercentageOfPrincipal`.
              format: float
              nullable: true
              type: number
            drawFeePercentageOfPrincipal:
              description: >
                The percentage of the purchases total amount. The system will
                calculate the draw fee amount based on the total

                of purchases in the period the draw was activated. The draw fee
                will be due on a due date of the period the draw

                was activated.  Pass only one of the following values,
                `drawFeeAmount` or `drawFeePercentageOfPrincipal`.
              format: float
              type: number
            dynamicFees:
              $ref: '#/components/schemas/AtOriginationDynamicFees'
            serviceFeeAmount:
              description: >
                **DEPRECATED ATTRIBUTE** Use `dynamicFees.feeAmount`.


                The service fee amount that will be charged recurrently. Only
                required if the service fee `amountLogic` is configured as

                `type=passedAtOrigination`. In all other cases, the system will
                calculate the fee based on pre-configured logic.
              format: float
              type: number
            serviceFeeCapAmount:
              description: >
                **DEPRECATED ATTRIBUTE** Use `dynamicFees.feeCapAmount`.


                The maximum amount of the service fee that can be charged over
                the life of the loan or draw. Only required if the service fee

                `capLogic` is configured as `type=capPassedAtOrigination`. In
                all other cases, the system will calculate the fee based on
                pre-configured

                logic.
              format: float
              type: number
          type: object
        gracePeriod:
          description: >
            The logic to handle grace period benefit. The draw level grace
            period functionality depends on the line/loan
            `isGracePeriodApplicable` attribute value that was passed in the
            `Create loan` endpoint.


            The grace period benefit can work in two ways in Peach:

            - Line level - in this case, the loan/line and all draws must meet
            the grace period repayment requirement.
              If one of the draws didn't meet the repayment requirement (in other words the entire line didn't meet the repayment requirement),
              all draws eligible for the grace period benefit would lose the grace period benefit and accrue interest.
            - Draw level - in this case each applicable/enrolled draw needs to
            meet its own grace period repayment requirements.
              If one of the applicable/enrolled draws didn't meet the repayment requirements, other draws might still be eligible for the grace
              period benefit (as long as they meet their own requirements).

            Line level (`loan.isGracePeriodApplicable=true`):

            - Assuming you enrolled the line/loan in the grace period benefit
            when you created the loan/line via `Create loan` endpoint, you can

            set the following draw-level attributes:

            - `draw.isGracePeriodApplicable`:
                - `false` - the draw participates in the eligibility evaluation for the entire line/loan. The draw will accrue interest based on
                the draw interest rate even when the line is eligible for the benefit.
                - `true` - the draw participates in the eligibility evaluation for the entire line/loan. The draw will NOT accrue interest in periods
                when the loan/line is eligible for the grace period benefit.
            - `draw.paymentRequirementForGrace` - defines what portion of the
            draw needs to be repaid every period to keep the line eligible for
            the benefit.
                - Keep in mind that you can set `draw.isGracePeriodApplicable=false` AND `draw.paymentRequirementForGrace = [minAmount, fullBalance]`.
                  It means that the draw will accrue interest (aka not subject to the grace period benefit). But, the line eligibility depends on
                  repayment of a portion of the draw. This configuration can be used for amortized draws when the borrower is expected to accrue interest
                  but has to pay the amortized recurring amount every period to keep the line eligible for the grace period.
            - `draw.numPeriodsToRestoreGrace` - is superseded by the line/loan
            level's `numPeriodsToRestoreGrace` value.

            - The following configurations are not allowed:
                - `draw.isGracePeriodApplicable=true` AND `draw.paymentRequirementForGrace=none`
                - `draw.isGracePeriodApplicable=true` for amortized draws. Amortized draws can participate in grace eligibility evaluation for a line/loan,
                but are not designed to be subject to the grace period benefit (in other words, amortized draws are expected to accrue interest if an interest
                rate greater than zero was set on the draw).

            Line level (`loan.isGracePeriodApplicable=false`):

            - Assuming you didn't enroll the line/loan in the grace period
            benefit when you created the loan/line via the `Create loan`
            endpoint, you can still

            enroll individual draws in the grace period benefit:

            - `draw.isGracePeriodApplicable`:
                - `false` - the draw is not enrolled in the grace period benefit and will accrue interest based on the draw interest rate.
                - `true` - the draw is enrolled in the grace period benefit. The draw will NOT accrue interest in periods when the draw is eligible for the grace period benefit.
            - `draw.paymentRequirementForGrace` - defines what portion of the
            draw needs to be repaid every period to keep the draw eligible for
            the benefit.

            - `draw.numPeriodsToRestoreGrace` - defines number of periods to
            wait after the grace period benefit was revoked, and before it can
            become eligible again.

            - The following configurations are not allowed:
                - `draw.isGracePeriodApplicable=false` AND `draw.paymentRequirementForGrace in [minAmount, fullBalance]`
                - `draw.isGracePeriodApplicable=true` for amortized draws. Amortized draws are not designed to be subject to the grace period benefit (in other
                words, amortized draws are expected to accrue interest if an interest rate greater than zero was set on the draw).

            If the `gracePeriod` object is not passed, the system will assume
            that grace period benefit is not applicable to the draw.


            Important: the grace period attributes cannot be changed after the
            draw is activated.
          properties:
            isGracePeriodApplicable:
              description: >
                Defines how the interest on draw should accrue when the draw is
                eligible for the grace period benefit.


                `false` - the draw will accrue interest regardless of the grace
                period benefit eligibility.


                `true` - the draw will NOT accrue interest in periods when the
                loan/line and/or draw is eligible for the grace period benefit.
              type: boolean
            numPeriodsToRestoreGrace:
              description: >
                Number of periods to wait after the grace period benefit was
                revoked before the draw can become eligible again.

                To take advantage of the grace period, the borrower must pay
                their account balance according to the grace period benefit
                requirements on time for the number of billing periods provided.


                If you enrolled the loan/line in the grace period benefit when
                you created the loan via the `Create loan` endpoint, don't pass
                this attribute.

                The system will set the draw-level value equal to the
                loan/line-level value of `numPeriodsToRestoreGrace`.
              type: integer
            paymentRequirementForGrace:
              description: >
                This attribute determines the portion of a draw that needs to be
                repaid every period in order for the line/loan and/or draw to be

                eligible for the grace period benefit.


                Important:
                    - If the grace period benefit was set on the loan/line level, ALL draws participate in the eligibility evaluation regardless of the
                draw-level `isGracePeriodApplicable` value.


                = `minAmount` - requires the minimum amount of the draw to be
                paid every period.
                    - For an amortized draw, the minimum amount is the amortized periodic/recurring amount and applicable fees.
                    - For non-amortized draw, the minimum amount is what statement logic calculates.
                = `fullBalance` - requires the full balance of the draw to be
                paid every period. Don't set `fullBalance` for amortized draws.
              enum:
                - minAmount
                - fullBalance
              type: string
          type: object
        interestRates:
          $ref: '#/components/schemas/LoanInterestRatesAtOrigination'
        mdr:
          $ref: '#/components/schemas/MerchantDiscountRateObj'
        minPaymentCalculation:
          $ref: '#/components/schemas/MinPaymentCalculation'
        promoRates:
          $ref: '#/components/schemas/LoanPromoRatesAtOrigination'
          nullable: true
        rateCaps:
          $ref: '#/components/schemas/RateCapsAtOriginationDraw'
      type: object
    DrawAtOriginationCreate:
      allOf:
        - $ref: '#/components/schemas/DrawAtOrigination'
        - properties:
            minPaymentCalculation:
              allOf:
                - $ref: '#/components/schemas/MinPaymentCalculation'
                - required:
                    - percentageOfPrincipal
                  type: object
          type: object
    BaseDraw:
      allOf:
        - $ref: '#/components/schemas/BaseMixinWithoutTimestamps'
        - $ref: '#/components/schemas/BaseLoanMixin'
        - properties:
            atOrigination:
              $ref: '#/components/schemas/DrawAtOriginationCreate'
              required:
                - minPaymentCalculation
            current:
              allOf:
                - properties:
                    creditLimitAmount:
                      description: The credit limit amount.
                      format: float
                      type: number
                    duration:
                      $ref: '#/components/schemas/LoanDuration'
                    minPaymentCalculation:
                      $ref: '#/components/schemas/MinPaymentCalculation'
                    paymentFrequency:
                      $ref: '#/components/schemas/InstallmentPaymentFrequency'
                    periodicPayment:
                      description: >-
                        The most recent amortized periodic payment that was
                        calculated on `lastAmortizedAt`.
                      format: float
                      type: number
                    specificDays:
                      $ref: '#/components/schemas/SpecificDays'
                  type: object
              description: >-
                This object contains some draw details that were modified after
                origination.
              readOnly: true
            isClosed:
              description: >
                Indicates whether the Draw is closed. If `true`, new Purchases
                cannot be created.
              type: boolean
            nickname:
              default: Draw
              description: The draw's nickname as displayed in the UI.
              type: string
            object:
              enum:
                - draw
              readOnly: true
              type: string
            ratesValidation:
              allOf:
                - $ref: '#/components/schemas/InterestRateValidation'
              description: >-
                This object contains information on whether actual rates exceed
                the rate ranges defined on the loan type.
              readOnly: true
            status:
              $ref: '#/components/schemas/LoanStatus'
          required:
            - status
          type: object
      title: BaseDraw
    DrawResponse:
      allOf:
        - $ref: '#/components/schemas/BaseDraw'
        - properties:
            drawType:
              description: >
                Describes the type of line of credit purchases associated with
                the draw. Typically used in credit card use cases

                in which lenders set up draws specifically to be used for cash
                advances, balance transfers, etc.


                `cashAdvance` - must be set in order for Peach's system to
                automatically associate ATM withdrawal and other
                  cash-specific transactions with a specific draw. See Create card issuer endpoint and `drawMapping` attribute for additional configuration details.

                `balanceTransfer` - enables lenders to create a draw that will
                house balance transfer transactions.


                `regularPurchase` - enables lenders to create a draw used for
                day-to-day purchases. If this attribute is set,
                  Peach's system will automatically associate purchases with this draw based on the card issuer `drawMapping` logic.

                `static` - a special draw capturing all past data prior to the
                "migration cutoff date" for a migrated Line of Credit.
                Automatically created by the

                system when a Line of Credit is created with
                `migrationStatus=prepMigration`.
              enum:
                - balanceTransfer
                - cashAdvance
                - regularPurchase
                - static
              nullable: true
              type: string
          type: object
      title: Draw Response
    DrawsPaging:
      allOf:
        - $ref: '#/components/schemas/Paging'
        - properties:
            data:
              items:
                $ref: '#/components/schemas/DrawResponse'
              type: array
          type: object
    Draw:
      allOf:
        - $ref: '#/components/schemas/BaseDraw'
        - properties:
            drawType:
              description: >
                Describes the type of line of credit purchases associated with
                the draw. Typically used in credit card use cases

                in which lenders set up draws specifically to be used for cash
                advances, balance transfers, etc.


                `cashAdvance` - must be set in order for Peach's system to
                automatically associate ATM withdrawal and other
                  cash-specific transactions with a specific draw. See Create card issuer endpoint and `drawMapping` attribute for additional configuration details.

                `balanceTransfer` - enables lenders to create a draw that will
                house balance transfer transactions.


                `regularPurchase` - enables lenders to create a draw used for
                day-to-day purchases. If this attribute is set,
                  Peach's system will automatically associate purchases with this draw based on the card issuer `drawMapping` logic.
              enum:
                - balanceTransfer
                - cashAdvance
                - regularPurchase
              nullable: true
              type: string
          type: object
      title: Draw
    DrawAtOriginationUpdate:
      allOf:
        - $ref: '#/components/schemas/DrawAtOrigination'
        - properties:
            minPaymentCalculation:
              $ref: '#/components/schemas/MinPaymentCalculation'
          type: object
    DrawActivationResponse:
      properties:
        amountsValidation:
          $ref: '#/components/schemas/AmountsValidation'
        schedule:
          $ref: '#/components/schemas/LoanSchedule'
      type: object
    ExpectedPaymentsResult:
      allOf:
        - $ref: '#/components/schemas/IsLocked'
        - properties:
            paymentFrequency:
              description: The expected payments' frequency.
              enum:
                - weekly
                - everyTwoWeeks
                - twiceMonthly
                - monthly
                - singleTerm
              type: string
            schedule:
              items:
                $ref: '#/components/schemas/ExpectedPayment'
              type: array
            specificDays:
              $ref: '#/components/schemas/SpecificDays'
          type: object
    DeferRemainingBalancesRequest:
      properties:
        caseId:
          description: |
            An identifier of an existing case.
          nullable: true
          type: string
        deferralType:
          description: |
            The type of deferral.

            `capitalizeRemainingBalance` - the system will capitalize
            the remaining balance, overdue or due, of each obligation
            corresponding to the selected due dates.
            Capitalization means the following:

            - Overdue/due principal will become non-due principal.
            - Overdue/due interest will become non-due principal.
            - Overdue/due fees will become non-due principal.

            The net effect on the loan balance right after the deferral
            is zero.
            Keep in mind that because interest and fees are capitalized
            (aka principal increased), the borrower may accrue more
            interest in the future.

            The system will not check the line of credit and/or draw
            level credit limit.
            For example, If the line or draw balance before the deferral
            was above the credit limit, the system will still complete
            the deferral process.
          enum:
            - capitalizeRemainingBalance
          nullable: false
          type: string
        previewMode:
          default: false
          description: |
            If `previewMode=true`, the loan doesn't change and no
            changes are saved to the database. The preview mode allows
            you to see the total and breakdown of the deferred amounts.
          nullable: false
          type: boolean
        selectedDueDates:
          description: |
            Selected due dates to defer.
            Can only be due dates for which the statement was already
            generated.
            Past due dates should always have statements. Upcoming due
            date can only be selected if the statement was already
            generated.

            If you don't pass a value, the system will find all due
            dates / obligations with remaining balance and defer them.

            If you pass a value, make sure you don't create "holes".
            Hole is defined as leaving one or more due dates with
            remaining balance while trying to defer more recent due
            dates. The exception is we allow deferring only the most 
            recent due obligation.
            For example:

            - A line has three due dates / obligations with remaining
              balance: `Jun 5`, `Jul 5`, `Aug 5`.
            - You cannot pass the following due dates combinations:
              - `Jul 5` - because it makes Jun 5 a "hole".
              - `Jul 5, Aug 5` - because it makes Jun 5 a "hole".
              - `Aug 5` - because it makes Jun 5 and Jul 5 "holes".
              - `Jun 5, Aug 5` - because it makes Jul 5 "holes".
            - You can pass the following due dates combinations:
              - `Jun 5`
              - `Jun 5, Jul 5`
              - `Jun 5, Jul 5, Aug 5`
              - `Aug 5` - the most recent due obligation
          items:
            format: date
            nullable: false
            type: string
          nullable: false
          type: array
      required:
        - deferralType
      type: object
    DeferRemainingBalancesResponse:
      properties:
        deferredDrawIds:
          description: |
            The list of draws that participated in the deferral process.
          items:
            nullable: false
            type: string
          type: array
        deferredDueDates:
          description: |
            The list of due dates that were deferred.
            Keep in mind that this list can be different from the
            `selectedDueDates` list that was provided.
            For example: if `selectedDueDates` included a due date that
            didn't have corresponding obligation's remaining balance >
            0, the system will skip the due date and will not include it
            in the `deferredDueDates` list.
            Or, if the `selectedDueDates` was `null`, the system will
            return all due dates with corresponding obligation's
            remaining balance > 0 that were deferred.
          items:
            format: date
            nullable: false
            type: string
          nullable: false
          type: array
        totalDeferredAmounts:
          description: |
            Total amount that was deferred.
            To clarify, this is the sum of all amounts that were
            deferred across all due dates with corresponding
            obligation's remaining amount > 0.
          properties:
            allFeesAmount:
              description: |
                Total of all fees portion of the `totalAmount` deferred.
              format: float
              nullable: false
              type: number
            interestAmount:
              description: |
                The interest portion of the `totalAmount` that was
                deferred.
              format: float
              nullable: false
              type: number
            principalAmount:
              description: |
                The principal portion of the `totalAmount` that was
                deferred.
              format: float
              nullable: false
              type: number
            totalAmount:
              description: |
                The total deferred amount that was previously overdue or
                due.
              format: float
              nullable: false
              type: number
          required:
            - totalAmount
            - interestAmount
            - principalAmount
            - allFeesAmount
          type: object
      type: object
    DrawMigrationBalances:
      description: >
        The draw level balances passed here should be as of the "migration
        cutoff date" after the most recent statement was generated in your legal
        system.


        We expect `balances` to include interest FOR the last date of the
        previous period (aka endDate) but not for the most recent statement date
        (which is also the first day of the migration period).

        For example:

        - Migration period:
          - startDate: Aug 1, 2024
          - endDate: Aug 31, 2024
          - statementDate: Sep 1, 2024
          - dueDate: Sep 22, 2024
        - Previous period (also called "past period"):
          - startDate: Jul 1, 2024
          - endDate: Jul 31, 2024
          - statementDate: Aug 1, 2024
          - dueDate: Aug 22, 2024
        - Notes:
          - The balances should be as of Aug 1, 2024 after the statement was generated on Aug 1, 2024.
          - End of day principal balance on Jul 31, 2024: $100.00.
          - The line/draw accrues daily simple interest of 18% annually (with 360 method).
          - The balances passed to Peach should include the daily interest that was accrued at the end of the day Jul 31, 2024:
          - $100.00 * (0.18 / 360) = $0.05
          - Peach system will accrue daily interest for the end of the day Aug 1, 2024 day balance and onward.
      properties:
        creditLimitAmount:
          description: |
            The draw credit limit amount as of the "migration cutoff date".
          format: float
          minimum: 0
          multipleOf: 0.01
          type: number
        dueBalances:
          description: Due balances represent balances that are currently due.
          properties:
            dueDrawFeesAmount:
              description: The draw fees portion of `dueFeesAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
            dueInterestAmount:
              description: The interest portion of the `dueTotalAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
            dueLateFeesAmount:
              description: The late fees portion of `dueFeesAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
            dueModificationFeesAmount:
              description: The modification fees portion of `dueFeesAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
            duePrincipalAmount:
              description: The principal portion of the `dueTotalAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
          required:
            - duePrincipalAmount
            - dueInterestAmount
            - dueDrawFeesAmount
            - dueLateFeesAmount
            - dueModificationFeesAmount
          type: object
        nonDueBalances:
          description: Non-due balances represent balances that are not yet due.
          properties:
            nonDueDrawFeesAmount:
              description: The draw fees portion of `nonDueFeesAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
            nonDueInterestAmount:
              description: The interest portion of the `nonDueTotalAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
            nonDueLateFeesAmount:
              description: The late fees portion of `nonDueFeesAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
            nonDueModificationFeesAmount:
              description: The modification fees portion of `nonDueFeesAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
            nonDuePrincipalAmount:
              description: The principal portion of the `nonDueTotalAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
          required:
            - nonDuePrincipalAmount
            - nonDueInterestAmount
            - nonDueDrawFeesAmount
            - nonDueLateFeesAmount
            - nonDueModificationFeesAmount
          type: object
        overdueBalances:
          description: Overdue balances represent balances that are overdue.
          properties:
            overdueDrawFeesAmount:
              description: The draw fees portion of `overdueFeesAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
            overdueInterestAmount:
              description: The overdue interest portion of the `overdueTotalAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
            overdueLateFeesAmount:
              description: The late fees portion of `overdueFeesAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
            overdueModificationFeesAmount:
              description: The modification fees portion of `overdueFeesAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
            overduePrincipalAmount:
              description: The overdue principal portion of the `overdueTotalAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
          required:
            - overduePrincipalAmount
            - overdueInterestAmount
            - overdueDrawFeesAmount
            - overdueLateFeesAmount
            - overdueModificationFeesAmount
          type: object
      required:
        - nonDueBalances
        - dueBalances
        - overdueBalances
      type: object
    BaseMigrationGracePeriod:
      properties:
        fullBalanceAmount:
          description: >-
            The full balance amount of the line that is eligible for grace
            period.
          format: float
          minimum: 0
          multipleOf: 0.01
          nullable: true
          type: number
        fullBalanceMinusOverdueAmount:
          description: The full balance amount minus the overdue amount.
          format: float
          minimum: 0
          multipleOf: 0.01
          nullable: true
          type: number
        isGracePeriodEligible:
          default: true
          description: Was the loan eligible for grace in this period?
          nullable: false
          type: boolean
      required:
        - fullBalanceAmount
        - fullBalanceMinusOverdueAmount
      type: object
    DrawMigrationGracePeriod:
      allOf:
        - $ref: '#/components/schemas/BaseMigrationGracePeriod'
        - description: >
            If you are not migrating past periods and the migration period is
            the first period of the LOC:


            Don't pass the `gracePeriod` object.


            If you are migrating past periods:


            This is the draw level grace period details.


            The draw level grace period data passed here corresponds to the
            previous period and not to the migration period. By the time you
            call this endpoint, you should have already created one or more past
            periods. The additional data that you pass here is only required for
            the previous period and not for all past periods. That's why the
            draw level grace period data is part of the "Create migration period
            draw data" vs "Create past periods data" endpoint.


            The migration period is a "live" period in which you execute
            migration.
              - Because the Peach system needs to know if the LOC is eligible for the grace period benefit when the migration period starts, the system
                will use the `isGracePeriodEligible` passed here. If you pass `isGracePeriodEligible=true`, the system will start migration without
                accruing interest in the "migration period". If you pass `isGracePeriodEligible=false`, the system will start migration with accruing
                interest in the "migration period".
              - On the "due date + 1" within the "migration period", the system evaluates the grace eligibility based on `fullBalanceAmount`, `fullBalanceMinusOverdueAmount` and payments made.
              - If you migrate the LOC/draw before the upcoming "due date", the system will evaluate the grace period eligibility in "live" and might revoke the benefit.
              - If you migrate the LOC/draw after the "due date", the system will evaluate the grace period eligibility as part of the "replay/migration" process.
                Because of existing limitations with "replay", grace period eligibility cannot be revoked as part of the replay process. However, the replay
                process can reinstate the grace period benefit (in other words, waive accrued interest from the start of the "migration period").
              - Peach is responsible for generating the statement corresponding to the migration period on `migrationPeriod.statementDate` in the future.
                The grace period details of the migration period will be calculated by the Peach system on `migrationPeriod.statementDate` in the future.

            For example:

            - Migration period:
              - startDate: Aug 1, 2024
              - endDate: Aug 31, 2024
              - statementDate: Sep 1, 2024
              - dueDate: Sep 22, 2024
            - Previous period (also called "past period"):
              - startDate: Jul 1, 2024
              - endDate: Jul 31, 2024
              - statementDate: Aug 1, 2024
              - dueDate: Aug 22, 2024
            - Notes:
              - The draw level grace period details that you need to pass correspond to the previous period that started on Jul 1, 2024 and ended on Jul 31, 2024.
              - The amounts and values should be as of the "migration cutoff date", Aug 1, 2024, after the statement was finalized in your legacy system.
          type: object
    MigratedDaysOverdue:
      description: >
        This represents the number of days overdue prior to the "migration
        cutoff" date as it appears in

        the other system (not Peach). This value is normally calculated as the
        number of calendar

        days overdue starting from the earliest overdue obligation's due date to
        the

        "migration cutoff date". This value, once set, won't change after the
        migration.


        This value will be prorated and added to `daysOverdue` of future
        obligations

        (if any become overdue). The system will prorate the
        `migratedDaysOverdue`

        dynamically as the borrower makes payments and add it to the days
        overdue

        post "migration cutoff date".


        Calculation details:
          - The `migratedDaysOverdue` value will be used to prorate days overdue prior to the "migration cutoff date"
            based on the paid balance of `migratedOverdueAmount` (which is set based on the `balances.overdueBalances`).
          - round_down [migratedDaysOverdue x (1 - min(fulfilledAmount / migratedOverdueAmount, 1))]
          - For example:
            - migratedDaysOverdue = 60
            - migratedOverdueAmount = $1000
            - Scenario 1:
              - Borrower didn't make any payment within the first 30 days after the "migration cutoff date".
              - Total days overdue:
                - 60 x (1 - min(0 / 1000, 1)) + 30 = 90
            - Scenario 2:
              - Borrower made payments in a total amount of $700 within the first 30 days after the "migration cutoff date". The line is still overdue.
              - Total days overdue:
                - 60 x (1 - min(700 / 1000, 1)) + 30 = 48
      minimum: 0
      nullable: false
      type: integer
    DrawMigrationObligation:
      description: >
        If you are not migrating past periods and the migration period is the
        first period of the LOC:


        Don't pass the `obligation` object.


        If you are migrating past periods:


        This is the draw level obligation details.


        The draw level data passed here corresponds to the previous period and
        not to the migration period. By the time you call this endpoint, you
        should have already created one or more past periods. The additional
        data that you pass here is only required for the previous period and not
        for all past periods. That's why the draw level obligation data is part
        of the "Create migration period draw data" vs "Create past periods"
        endpoint.


        To remind, the migration period is a "live" period in which you execute
        migration. The draw level obligation details of the migration period
        will be calculated by the Peach system. Peach is also responsible for
        generating the statement corresponding to the migration period on
        `migrationPeriod.statementDate` in the future.


        For example:

        - Migration period:
          - startDate: Aug 1, 2024
          - endDate: Aug 31, 2024
          - statementDate: Sep 1, 2024
          - dueDate: Sep 22, 2024
        - Previous period (also called "past period"):
          - startDate: Jul 1, 2024
          - endDate: Jul 31, 2024
          - statementDate: Aug 1, 2024
          - dueDate: Aug 22, 2024
        - Notes:
          - The draw level obligation details that you need to pass correspond to the previous period that started on Jul 1, 2024 and ended on Jul 31, 2024.
          - The amounts and other values should be as of the "migration cutoff date", Aug 1, 2024, after the statement was finalized in your legacy system.
      properties:
        migratedDaysOverdue:
          $ref: '#/components/schemas/MigratedDaysOverdue'
        obligationAmount:
          description: >
            The remaining amount of the previous period's obligation that a
            borrower needs to pay on the due date that comes after "migration
            cutoff date". The remaining amount should be as of "migration cutoff
            date" vs. "migration at date".


            This is the draw level remaining obligation amount.


            If your LOC (or credit card) product doesn't count payments that
            were made before the statement date towards the statement minimum
            amount, then `obligationAmount` must be always equal to the draw
            portion of the whole statement minimum amount.


            Example:
              - Migration period:
                - startDate: Aug 1, 2024
                - endDate: Aug 31, 2024
                - statementDate: Sep 1, 2024
                - dueDate: Sep 22, 2024
              - Previous period (also called "past period"):
                - startDate: Jul 1, 2024
                - endDate: Jul 31, 2024
                - statementDate: Aug 1, 2024
                - dueDate: Aug 22, 2024

            Scenario 1:
              - The draw minimum payment was calculated as $100 on the statement date on Aug 1, 2024.
              - A borrower made some payments in the previous period, and based on your waterfall configuration in the legacy system, $30 was counted towards the $100 minimum amount. 
              - The remaining minimum amount of $70 is due on Aug 22, 2024.
              - You should pass `obligationAmount=70`.

            Scenario 2:
              - The draw minimum payment was calculated as $100 on the statement date on Aug 1, 2024.
              - A borrower made some payments in the previous period, and based on your waterfall configuration in the legacy system, none of the payments were counted toward the $100 minimum amount. 
              - The minimum amount of $100 is due on Aug 22, 2024.
              - You should pass `obligationAmount=100`.

            Scenario 3:
              - The draw minimum payment was calculated as $100 on the statement date on Aug 1, 2024.
              - A borrower made early payments in the previous period, and based on your waterfall configuration in the legacy system, the payments were counted toward the $100 minimum amount. 
              - The remaining minimum amount of $0 is due on Aug 22, 2024 (in other words, the borrower doesn't need to pay anything on Aug 22, 2024.)
              - You should pass `obligationAmount=0`.
          format: float
          minimum: 0
          multipleOf: 0.01
          nullable: false
          type: number
      required:
        - obligationAmount
        - migratedDaysOverdue
      type: object
    MigrationPeriodDrawData:
      properties:
        balances:
          $ref: '#/components/schemas/DrawMigrationBalances'
        gracePeriod:
          $ref: '#/components/schemas/DrawMigrationGracePeriod'
        obligation:
          $ref: '#/components/schemas/DrawMigrationObligation'
      type: object
    MigrationPeriodDrawDataResponse:
      allOf:
        - $ref: '#/components/schemas/SingletonResponse'
        - properties:
            data:
              allOf:
                - $ref: '#/components/schemas/MigrationPeriodDrawData'
                - properties:
                    migratedOverdueAmount:
                      format: float
                      nullable: true
                      type: number
                  type: object
          type: object
    MigrationPeriodDrawDataWithRequired:
      allOf:
        - $ref: '#/components/schemas/MigrationPeriodDrawData'
        - required:
            - obligation
            - gracePeriod
            - balances
          type: object
    ObligationAmountFields:
      properties:
        capitalizedAmount:
          description: |
            The total amount capitalized at the end of the period.
          format: float
          nullable: true
          type: number
        fulfilledAmount:
          description: >
            The total amount of payments and service credits applied to the
            period.
          format: float
          nullable: true
          type: number
        obligationAmount:
          description: |
            The amount obligated to be paid by the borrower for the period.
          format: float
          type: number
        overLimitAmount:
          format: float
          nullable: true
          type: number
        overpaymentsAmount:
          description: >
            In the case that loan policy allows, this represents the amount of
            overpayments applied to the period.

            Overpayments will only arise when an obligation is completely
            fulfilled.
          format: float
          nullable: true
          type: number
        paymentsAmount:
          description: |
            The total amount of payments applied to the period.
          format: float
          nullable: true
          type: number
        remainingAmount:
          description: >
            The total amount remaining to be paid by the borrower after
            accounting for payments

            and service credits applied in the period.
          format: float
          nullable: true
          type: number
        serviceCreditsAmount:
          description: |
            The total amount of service credits applied to the period.
          format: float
          nullable: true
          type: number
        unassignedAmount:
          description: >
            This is a special amount that only applies to loan types with
            `obligationFulfilledCalculation=postStatement` or
            `obligationFulfilledCalculation=postDueDate` configuration.

            This is not counted towards an obligation's fulfilled amount.


            - For the first obligation, it stores any payment amount that was
            made before the first statement date (postStatement) or due date
            (postDueDate) and is not allocated to any obligation.

            - For subsequent obligations, it stores any payment amount that was
            made between the previous period's due date +1 (inclusive) and
            current period's end date (inclusive).
          format: float
          nullable: true
          type: number
      type: object
    ObligationOtherFields:
      properties:
        dueDate:
          description: The due date of the obligation/period in the product timezone.
          format: date
          type: string
        isFulfilled:
          description: >
            `true` if the borrower has completely fulfilled the obligation
            amount for the period.
          type: boolean
        isLateFeeBlockedByPyramidingConfig:
          default: false
          description: >
            Pyramiding of late fees is a situation where a borrower (who has
            been previously charged a late fee) pays the current amount due

            on a loan without the prior month's late fee included, and the
            payment is applied to the late fee first, leaving an overdue balance

            on the current month's payment, resulting in another late fee.


            - If the late fee was configured to allow pyramiding effect, this
            attribute is not used and will be `false` always.

            - If the late fee was configured to prevent pyramiding effect
            (`pyramidingLateFeesAllowed=false`), this attribute:
              - `true` - means a late fee was blocked (aka not charged in the period) because of the late fee pyramiding configuration.
                But otherwise would have been charged.
              - `false` - means a late fee was charged because the loan was overdue, or a late fee was not supposed to be charged because
                  the loan was current. To clarify, `false` doesn't necessarily mean that a late fee was charged in the period. To understand
                  whether a late fee was charged in the period, you should check the dynamic fees endpoint or applicable database table(s).
          type: boolean
        isOpen:
          description: >
            `true` means that the obligation is still "open" and the
            `obligationAmount` is not final. The obligation amount

            can potentially change until the period ends. `false` means that the
            obligation is "sealed" and the `obligationAmount`

            is final.
          type: boolean
        isOverdue:
          description: >
            `true` if the borrower is currently overdue on the obligation amount
            for the period.
          type: boolean
        migration:
          description: |
            Used in Line of Credit migration.
          properties:
            migratedDaysOverdue:
              description: >
                The number of calendar days overdue as of the "migration cutoff
                date". This value is pro-rated based on the percentage

                of the `migratedOverdueAmount` paid by the borrower.
              nullable: true
              type: integer
            migratedOverdueAmount:
              description: >
                The overdue balance as of the "migration cutoff date". This
                value is equal to the total of `balances.overdueBalances`

                that is used to initiate the ledger as of the "migration cutoff
                date". This value won't change after the migration.
              format: float
              nullable: true
              type: number
            migratedOverdueRemainingAmount:
              description: >
                The overdue balance remaining to be paid as of the "migration
                cutoff date". This value starts out equal to the total of

                `balances.overdueBalances` and decreases as subsequent payments
                are made by the borrower.
              format: float
              nullable: true
              type: number
          readOnly: true
          type: object
        periodId:
          description: The period identifier.
          type: string
      type: object
    ObligationGracePeriod:
      description: Data used for grace period logic.
      properties:
        fullBalanceAmount:
          description: >
            This attribute is only used for grace period benefit logic. The
            fullBalanceAmount is dependent on the repaymentCriteriaForGrace
            attribute.


            For repaymentCriteriaForGrace = none, this value is zero.


            For repaymentCriteriaForGrace = minAmount, this amount is the
            obligation for this period and the unpaid portion of past
            obligations as of the date when the obligation is "sealed".

            Line of credit (and Draw) obligations are "sealed" on the statement
            date.


            For repaymentCriteriaForGrace = fullBalance, this amount is the full
            statement balance amount (also called "new balance") as of the date
            when the obligation is "sealed".

            Line of credit (and Draw) obligations are "sealed" on the statement
            date.
          format: float
          nullable: true
          type: number
        fullBalanceMinusOverdueAmount:
          description: >
            This attribute is only used for grace period benefit logic. The
            fullBalanceMinusOverdueAmount is dependent on the
            repaymentCriteriaForGrace attribute.


            For repaymentCriteriaForGrace = none, this value is zero.


            For repaymentCriteriaForGrace = minAmount, this amount is the
            obligation for this period as of the date when the obligation is
            "sealed".

            Line of credit (and Draw) obligations are "sealed" on the statement
            date.


            For repaymentCriteriaForGrace = fullBalance, this amount is the full
            statement balance amount (also called "new balance")

            minus any overdue amount as of the date when the obligation is
            "sealed" (aka when isOpen is set to false).
          format: float
          nullable: true
          type: number
        isGracePeriodEligible:
          description: >-
            The grace period status of the obligation period.

            `true` - means that the period is/was eligible for the grace period
            benefit and interest didn't accrue in the period.

            `false` - means that the period was not eligible for the grace
            period benefit and interest accrued in the period.
          type: boolean
        totalFulfilledOnDueDateAmount:
          description: >
            This value is only used for grace period benefit logic. The value
            will be set one calendar day after the due date.

            The amount of the obligation for the period fulfilled by service
            credits and borrower payments as of the end of the

            due date. This is a sum of `fulfilledAmount` and
            `overpaymentsAmount`.
          format: float
          nullable: true
          type: number
      type: object
    ObligationResult:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - $ref: '#/components/schemas/ObligationAmountFields'
        - $ref: '#/components/schemas/ObligationOtherFields'
        - properties:
            gracePeriod:
              $ref: '#/components/schemas/ObligationGracePeriod'
          type: object
    ObligationsResult:
      allOf:
        - $ref: '#/components/schemas/IsLocked'
        - properties:
            daysOverdue:
              description: >
                Number of calendar days overdue starting from the due date of
                the earliest overdue obligation to

                the current date.
              type: integer
            isOverdue:
              description: |
                `true` if the borrower has any obligation overdue on the loan.
              type: boolean
            obligations:
              items:
                $ref: '#/components/schemas/ObligationResult'
              type: array
            overdueAmount:
              description: |
                The total overdue amount across all obligations on the loan.
              format: float
              type: number
          type: object
    PromoProgramPost:
      allOf:
        - $ref: '#/components/schemas/PromoProgramCreate'
        - properties:
            caseId:
              description: An identifier for an existing case.
              type: string
          type: object
      description: Create a promo program
    PromoCancelReason:
      description: |
        The cancellation reason.

          `adminError` - the promo program was added by mistake.

          `expired` - the promo expired.

          `disqualified` - the promo was disqualified for various
          reasons.

          `borrowerOptedOut` - the borrower decided to opt out from the
          promotional program.
      enum:
        - adminError
        - expired
        - disqualified
        - borrowerOptedOut
      type: string
    PromoProgramResult:
      properties:
        caseId:
          description: An identifier for an existing case.
          type: string
        description:
          description: |
            A legal description of the promotional program as it should
            be communicated and shown to borrowers.
            If the description is provided, borrowers will see the
            description in the Borrower Portal.
          nullable: true
          readOnly: true
          type: string
        displayName:
          description: The promotional program name as it is shown to borrowers.
          readOnly: true
          type: string
        disqualifyOverdueDays:
          description: |
            The number of loan overdue days that would disqualify the
            promotional program.
            Any occurrence of `disqualifyOverdueDays` or more of number
            days overdue during the promotional period would disqualify
            (aka cancel) the promotional program.
          type: integer
        externalId:
          description: |
            A lender's unique identifier for a specific promotional
            program.
          type: string
        id:
          description: The promotional program's unique identifier.
          readOnly: true
          type: string
        loanId:
          allOf:
            - $ref: '#/components/schemas/AnyId'
            - description: The ID of the loan the promo program applies to.
        metaData:
          description: |
            Store any type of key/value pairs in the form of a JSON
            dictionary.
          nullable: true
          type: object
        promoCancelReason:
          $ref: '#/components/schemas/PromoCancelReason'
        promoCanceledBy:
          $ref: '#/components/schemas/UserActionInfo'
          description: |
            Details of the user responsible for canceling the promotion
            program.
            Can be an borrower, agent, or automated system process.
        promoDurationDays:
          description: |
            The promotional program duration as a number of calendar
            days.
            If `promoDurationDays` is passed, the system will calculate
            the `promoEndDate`.
            Pass only one of the attributes, `promoEndDate` or
            `promoDurationDays`.
          type: integer
        promoEffectiveEndDate:
          description: |
            The promotional program effective end-date inclusive of the
            `promoGracePeriodDays`.
            If the `promoGracePeriodDays` is not passed, the
            `promoEffectiveEndDate` will be equal to the `promoEndDate`.
          format: date
          readOnly: true
          type: string
        promoEndDate:
          $ref: '#/components/schemas/PromoEndDate'
        promoGracePeriodDays:
          $ref: '#/components/schemas/PromoGracePeriodDays'
        promoStartDate:
          $ref: '#/components/schemas/PromoStartDate'
        promoType:
          $ref: '#/components/schemas/PromoType'
        promoTypeId:
          description: The promotional program type's unique identifier.
          type: string
        remainingAmountToExercise:
          description: |
            The remaining amount needed to satisfy the Same-As-Cash
            promotion.
            Only returned if `promoStatus=active`.
          format: float
          nullable: true
          type: number
        sacExcercisedRateId:
          description: |
            The unique rate ID that was created to set on the loan in
            order to exercise the promotion rate.
          type: string
        status:
          description: |
            The promotional program status on a specific loan.

              `pending` - the promotion was created but was not
              activated yet.

              `active` - the promotion is active.

              `canceled` - the promotion has been canceled for a reason.
              The reason provided in the `promoCancelReason` attribute.

              `exercised` - the promotion was successfully exercised.
          enum:
            - pending
            - active
            - canceled
            - exercised
          readOnly: true
          type: string
        timestamps:
          description: Timestamps of the transaction statuses.
          properties:
            activatedAt:
              format: date-time
              type: string
            canceledAt:
              format: date-time
              type: string
            createdAt:
              format: date-time
              type: string
            exercisedAt:
              format: date-time
              type: string
            reactivatedAt:
              format: date-time
              type: string
          type: object
        totalDeferredInterestAmount:
          description: |
            The total deferred interest amount at the time when promo
            status changed from `active` to `canceled` or `exercised`.

            When the promotion is `canceled` the total deferred interest
            is added to the loan interest and the borrower is expected
            to pay it.
            When the promotion is `exercised` the total deferred
            interest is foregone and the borrower is not expected to pay
            it.

            If the promo status is `active` the value will be empty.
            If you want to know how much deferred interest was accrued
            on an `active` promotion, please use "Get loan balances" or
            "Get draw balances" endpoints.
          format: float
          type: number
      type: object
    PromoProgramPutCommon:
      properties:
        caseId:
          description: An identifier for an existing case.
          type: string
        disqualifyOverdueDays:
          description: |
            The number of loan overdue days that would disqualify
            the promotional program.
            Any occurrence of `disqualifyOverdueDays` or more during
            the promotional period would disqualify (aka cancel) the
            promotional program.
          type: integer
        externalId:
          description: |
            A lender's unique identifier for a specific promotional
            program.
          type: string
        metaData:
          description: |
            Store any type of key/value pairs in the form of a JSON
            dictionary.
          nullable: true
          type: object
        promoDurationDays:
          description: |
            The promotional program duration as a number of calendar
            days.
            If `promoDurationDays` is passed, the system will
            calculate the `promoEndDate`.
            Pass only one of the attributes, `promoEndDate` or
            `promoDurationDays`.
          type: integer
        promoEndDate:
          $ref: '#/components/schemas/PromoEndDate'
        promoGracePeriodDays:
          $ref: '#/components/schemas/PromoGracePeriodDays'
        promoStartDate:
          $ref: '#/components/schemas/PromoStartDate'
      type: object
    PromoProgramDeleteResult:
      allOf:
        - $ref: '#/components/schemas/PromoProgramResult'
        - properties:
            sendNotice:
              default: true
              description: |
                When set to `true` the system will send a
                `promoProgramCanceled` notice to the borrower.
              type: boolean
          type: object
    PurchaseExtraInput:
      properties:
        authorizedAt:
          description: >
            The timestamp when the purchase was `authorized`. This value can be
            set by lenders at the time of purchase creation.

            If the value is not set by the lender, it will be populated based on
            `authorizedAt` (if it is non-null) otherwise `createdAt` for the
            corresponding `authorizationPurchaseId`.

            If the value is not set by the lender and no
            `authorizationPurchaseId` is set, this value corresponds to
            `purchase.authorized` event.

            If the purchase was never in `authorized` status and none of the
            prior conditions are met, this value will be null.
          format: date-time
          type: string
        effectiveAt:
          description: >
            The effective timestamp when the purchase was applied in the ledger.
            This attribute can be passed only during the line of credit
            migration process.

            Don't use this attribute after the migration process was
            successfully completed.


            `effectiveAt` is equal to the timestamp when the purchase is set to
            `pending` or `settled` status, whichever comes first.

            The timezone is UTC for this timestamp and the format is ISO. For
            example, in order to set a purchase `effectiveAt` to July 28th 2022,

            10:44 am PDT, send `2022-07-28T17:44:00Z`.
          format: date-time
          type: string
      type: object
    PurchaseValidationWarnings:
      description: >-
        Soft validation warnings for fields the system accepted without
        enforcing.
      properties:
        cardIdMissing:
          description: >-
            True when `cardId` was provided but could not be resolved to a card
            on this loan.
          type: boolean
      type: object
    PurchaseCreateOrUpdateResponse:
      allOf:
        - $ref: '#/components/schemas/SingletonResponse'
        - properties:
            data:
              $ref: '#/components/schemas/Purchase'
            validation:
              $ref: '#/components/schemas/PurchaseValidationWarnings'
          type: object
    PurchaseUpdate:
      properties:
        amount:
          description: The amount of the purchase.
          minimum: 0
          type: number
        authorizationPurchaseId:
          description: >
            Peach's unique or lender's external identifier for the authorization
            purchase. This attribute is used to reference an initial
            authorization, so

            lenders know which captures (purchase object(s) in Peach) are
            related to the original authorization.
          type: string
        authorizedAt:
          description: |
            The timestamp when the purchase was `authorized`.
          format: date-time
          type: string
        cardId:
          description: >
            Peach id, Peach public id (`CD-...`), or lender external id
            (`ext-...`) of the card used for this purchase.

            Resolved against cards belonging to this line of credit. If the card
            cannot be resolved (unknown id or wrong loan),

            the purchase is still updated and `validation.cardIdMissing` is set
            to `true` in the response.
          maxLength: 200
          nullable: true
          type: string
        declineReason:
          $ref: '#/components/schemas/PurchaseDeclineReason'
          description: The reason the purchase was declined
        effectiveAt:
          description: >
            The effective timestamp when the purchase was applied in the ledger.
            `effectiveAt` is equal to the timestamp when the purchase is set to

            `pending` or `settled` status, whichever comes first. Changing the
            `effectiveAt` via the `Update purchase` endpoint will trigger a
            replay

            of the line of credit. Keep in mind that an existing statement
            might've included the purchase based on the existing `effectiveAt`
            value

            and the interest was accrued based on the existing `effectiveAt`.
            `effectiveAt` can be updated only if the purchase is in `settled` or
            `pending` status.


            The timezone is UTC for this timestamp and the format is ISO.

            For example, in order to set a purchase `effectiveAt` to July 28th
            2022, 10:44 am PDT, send `2022-07-28T17:44:00Z`
          example: 2022-06-10T11:45Z
          format: date-time
          type: string
        externalId:
          description: The lender's identifier for the purchase.
          nullable: true
          type: string
        metadata:
          type: object
        originalPurchaseId:
          description: >
            Peach's unique or lender's external identifier. Typically used for
            purchases of type `refund` which allows the lender to

            reference the original purchase being refunded. For authorizations,
            please see `authorizationPurchaseId` attribute.
          type: string
        purchaseDate:
          description: >
            The date of a purchase. This attribute can be passed only during the
            line of credit migration process.

            Don't use this attribute after the migration process was
            successfully completed.


            - The value must be before or equal to today, and cannot be greater
            than the "migration at date" (aka the actual date on which you run
            the migration.)

            - If you pass `purchaseDate` you cannot pass `authorizedAt` and/or
            `effectiveAt`.

            - If `purchaseDate` is passed, the system will set `authorizedAt`
            and `effectiveAt` to `purchaseDate` at 6:00 AM in the product
            timezone.

            - If you `purchaseDate` is not passed, you must pass both
            `authorizedAt` and `effectiveAt`. `authorizedAt` cannot be greater
            than `effectiveAt`.


            For non-migrated purchases:

            - The value is equal to the date part of the `authorizedAt`
            converted to the product timezone (e.g. Eastern or Pacific).
              If `authorizedAt` is null, this value is equal to the date part of the purchase's `createdAt` converted to the product timezone.

            The `purchaseDate` is returned in Get endpoints for both migrated
            and non-migrated purchases.
          format: date
          type: string
        purchaseDetails:
          $ref: '#/components/schemas/PurchaseDetails'
        status:
          $ref: '#/components/schemas/PurchaseStatus'
      type: object
    PurchaseUpdateInternal:
      allOf:
        - $ref: '#/components/schemas/PurchaseUpdate'
        - properties:
            refundDetails:
              $ref: '#/components/schemas/InternalRefundDetails'
          type: object
    RateCapEndDate:
      description: >
        Rate cap end date in product timezone, inclusive. If null, applies until
        end of loan/draw.
      format: date
      nullable: true
      type: string
    RateCapStartDate:
      description: Rate cap start date in product timezone, inclusive.
      format: date
      type: string
    RateCap:
      description: >
        The Rate Cap object represents the rate caps associated with each loan
        or draw. 

        Rate caps apply to both `spread` and `absolute` rate types. If two or
        more rate 

        caps overlap on the same dates, we will use the lowest value.
      properties:
        createdAt:
          description: When the rate cap was created.
          format: date-time
          type: string
        endDate:
          $ref: '#/components/schemas/RateCapEndDate'
        id:
          description: The rate cap identifier.
          type: string
        maxRate:
          $ref: '#/components/schemas/RateCapMaxRate'
        rateCapReason:
          $ref: '#/components/schemas/RateCapReason'
        startDate:
          $ref: '#/components/schemas/RateCapStartDate'
        updatedAt:
          description: When the rate cap was last updated.
          format: date-time
          type: string
      title: Rate Cap
      type: object
    RateCapAdd:
      description: Request body for adding a new rate cap.
      properties:
        endDate:
          $ref: '#/components/schemas/RateCapEndDate'
        maxRate:
          $ref: '#/components/schemas/RateCapMaxRate'
        rateCapReason:
          $ref: '#/components/schemas/RateCapReason'
        startDate:
          $ref: '#/components/schemas/RateCapStartDate'
      required:
        - maxRate
        - startDate
        - rateCapReason
      title: Rate Cap Add
      type: object
    RateCapId:
      description: The rate cap identifier.
      example: RC-ABCD-1234
      pattern: ^RC-[A-Z0-9]{4}-[A-Z0-9]{4}$
      type: string
    RateCapUpdate:
      description: Request body for updating an existing rate cap.
      properties:
        endDate:
          $ref: '#/components/schemas/RateCapEndDate'
        maxRate:
          $ref: '#/components/schemas/RateCapMaxRate'
        rateCapReason:
          $ref: '#/components/schemas/RateCapReason'
        startDate:
          $ref: '#/components/schemas/RateCapStartDate'
      title: Rate Cap Update
      type: object
    LoanRate:
      description: >-
        Loan can have multiple rates. If two or more `interestRate` overlap on
        the same date we use the lowest value.

        If two or more `promoRate` overlap on the same date, we take the sum of
        the promo rates for the given day, and cap this rate at the maximum
        interest rate for the given day (to avoid accruing negative interest).
      properties:
        annualRate:
          description: >-
            The annual interest or promo rate for the period defined. Format is
            decimal. For example, 0.01 is 1% annual rate, 0.2 is 20% annual
            rate.
          format: float
          type: number
        endDate:
          description: >
            The rate end date in the product timezone. The end date is
            inclusive.

            If `null` then the rate is applicable until the end of the loan.
          format: date
          nullable: true
          type: string
        id:
          description: Unique identifier of the interest or promo rate.
          readOnly: true
          type: string
        setAtActivation:
          description: >
            `true` if the rate was set at loan activation. Rates set at
            activation cannot be removed

            without a special permission. Rates set after activation are set as
            `false` and do not

            require a special permission for removal.
          readOnly: true
          type: boolean
        startDate:
          description: >-
            The rate start date in the product timezone. The start date is
            inclusive.
          format: date
          type: string
        status:
          description: |
            The status of the rate.
            `active` - the rate is active.
            `inactive` - the rate is inactive as it was removed.
          enum:
            - active
            - inactive
          type: string
        type:
          enum:
            - interestRate
            - promoRate
          readOnly: true
          type: string
      required:
        - annualRate
        - startDate
      type: object
    InterestRate:
      allOf:
        - $ref: '#/components/schemas/LoanRate'
      description: >
        An interest rate on a loan.


        The system will treat the provided value according on the interest type
        that was set at the time of origination (see
        `atOrigination.interestType` attribute.)


        To remind, `interestType` can have one of the following values:
        `absolute` or `spread`.


        `absolute` - interest rates defined as `absolute` will use the value as
        provided in the `annualRate` attribute without adding the Index Interest
        Rate.
          - Negative interest `annualRate` value is not allowed.
          - If the provided `annualRate` is outside of the range defined on the loan type, the system will accept the `annualRate` but will return a warning in the response's object `ratesValidation`.

        `spread` - interest rates defined as `spread` will calculate an absolute
        rate by adding the relative loan rate (aka spread) provided in the

        `annualRate` attribute to the Index Interest Rate effective on the date
        the interest is accrued. In case the Index Interest Rate is not set,

        the system will assume that the Index Interest Rate value is zero on the
        date the interest is accrued.
          - Negative interest spread `annualRate` value is allowed, but the system will default to zero if the addition of the Index Interest Rate still results in a negative rate.
          - If the calculated absolute rate, `annualRate` (aka spread) plus Index Interest Rate, is outside of the range defined on the loan type, the system will accept the
          `annualRate` but will return a warning in the response's object `ratesValidation`.
      title: Interest rate
    InterestRateResponse:
      allOf:
        - $ref: '#/components/schemas/InterestRate'
        - properties:
            interestType:
              default: absolute
              description: >
                The interest type. The interest type cannot be changed after the
                loan status changes to `originated` and onward.

                Interest rates defined as `spread` will calculate an absolute
                rate by adding the relative loan rate (aka spread)

                provided here to the Index Interest Rate effective on the date
                the interest is accrued. In case the Index Interest

                Rate is not set, the system will assume that the Index Interest
                Rate value is zero on the date the interest is accrued.


                Interest rates defined as `absolute` will use the value as
                provided here without adding the Index Interest Rate.
              enum:
                - absolute
                - spread
              type: string
          type: object
    PromoRate:
      allOf:
        - $ref: '#/components/schemas/LoanRate'
      description: >
        A promo rate on a loan. If the annual interest rate is 0.25 and the
        promo rate for the corresponding

        period is 0.05, the net interest rate after application of the promo
        rate would be 0.2.
      title: Promo rate
    isEndExistingRatesFlag:
      properties:
        isEndExistingRates:
          default: false
          description: >
            If true, the system will set all existing rates that have
            `endDate=null` to the new rate's `startDate` minus one calendar day.

            Use this flag carefully as it might impact ALL existing rates. For
            example:

              - A loan has one existing rate of 0.05 with `startDate=2021-07-01` and `endDate=null`.
              - A new rate of 0.01 is added with `startDate=2021-08-05` and `isEndExistingRates=true`.
              - The rate of 0.05 will be updated, and the end date will be set to `endDate=2021-08-04`.

            Notes:

              - Only rates with `endDate=null` will be updated. If an existing rate has a defined end date, that rate will not be modified.
              - If an existing rate has `startDate` equal to the new rate, and `endDate=null`, the system will invalidate the existing rate vs. setting
                `endDate` to the new rate's `startDate` minus one calendar day. For example:

                  - A loan has one existing rate of 0.05 with `startDate=2025-10-02` and `endDate=null`.
                  - A new rate of 0.01 is added with `startDate=2025-10-02` and `isEndExistingRates=true`.
                  - The rate of 0.05 will be invalidated because the `endDate` cannot be `2025-10-01`.
          type: boolean
      type: object
    InterestRateValidationAfterOrig:
      properties:
        interestRateBelowMinOrZero:
          description: |
            `true` if the interest rate is below the minimum interest rate.
          readOnly: true
          type: boolean
        interestRateExceedsMax:
          description: |
            `true` if the interest rate exceeds the maximum interest rate.
          readOnly: true
          type: boolean
      type: object
    DueDatesRequest:
      properties:
        agreementDocumentId:
          description: >
            The document descriptor ID corresponding to the accepted loan term
            change agreement. This is required unless

            `previewMode=true` or `isShowRevisedTermsOnFrequencyChange=false` on
            the loan type.
          type: string
        caseId:
          description: |
            An identifier for an existing case.
          type: string
        dueDatesFrequency:
          default: monthly
          description: The frequency of due dates.
          enum:
            - weekly
            - everyTwoWeeks
            - twiceMonthly
            - monthly
            - singleTerm
          type: string
        previewMode:
          default: false
          description: >-
            In `previewMode=true`, the loan doesn't change, and no changes are
            saved to the database.
          type: boolean
        sendNotice:
          $ref: '#/components/schemas/SendNoticeCancelAutopay'
        specificDays:
          $ref: '#/components/schemas/SpecificDays'
      type: object
    LoanFee:
      properties:
        amount:
          description: The fee amount.
          format: float
          type: number
        createdDate:
          description: >
            **DEPRECATED ATTRIBUTE** Use `timestamps.createdAt`.**


            The date on which the fee was created. Fees in scheduled status have
            `createdDate` but not `dynamicFeeDetails.chargeDate` because

            they are not yet in the ledger. `originationFee` and `drawFee` are
            created and charged on the same day. `dynamicFee` can be created

            but charged later.
          format: date
          type: string
        dueDate:
          description: The date on which the fee is due.
          format: date
          type: string
        dynamicFeeDetails:
          description: >
            Additional details about the fee. This object was historically used
            for `type=dynamicFee` only, but now it is used for all fee types.

            Some attributes in this object are applicable only to
            `type=dynamicFee`. Please carefully read the description of each
            attribute.
          properties:
            apiName:
              $ref: '#/components/schemas/FeeApiName'
            canceledBy:
              description: Identifier of the `User` who canceled the fee.
              type: string
            canceledDate:
              description: >
                The date a fee was canceled in the product timezone. `null`
                indicates an uncanceled fee.

                Only applicable to `type=dynamicFee` fee.
              format: date
              type: string
            capitalizedAmount:
              description: >
                The amount of fee that was capitalized. Only applicable to
                `dynamicFee` fees.


                If the fee `amount` is different from the `originalAmount`, it
                can happen for a few reasons:
                  1. The fee amount was changed and the loan was replayed. In that case, both `capitalizedAmount` and `creditedAmount` attributes are not used. This is only possible for `originationFee` or `drawFee` fees.
                  2. Part or all of the fee amount was capitalized. In that case, the capitalized amount is represented by the `capitalizedAmount` attribute. This is only possible for `dynamicFee` fees.
                  3. Part or all of the fee amount was "covered" by a credit amount (also called `reimbursementAmount`) available on the line of credit. In that case, the credited amount is represented by the `creditedAmount` attribute. This is only possible for `dynamicFee` fees. Only applicable to lines of credit.

                For `dynamicFee`, if `capitalizedAmount` and `creditedAmount`
                are not `null`, the follow equation should be true:

                `originalAmount - amount = capitalizedAmount + creditedAmount`
              format: float
              nullable: true
              type: number
            caseId:
              description: An identifier for an existing case.
              type: string
            chargeDate:
              description: >-
                The date a fee was charged to the ledger in the product
                timezone.
              format: date
              type: string
            createdBy:
              description: |
                Identifier of the `User` who created the fee.
                Only applicable to `type=dynamicFee` fee.
              type: string
            creditedAmount:
              description: >
                The amount of the fee that was "covered" by a credit amount
                (also called `reimbursementAmount`) available on the line of
                credit. Only applicable to `dynamicFee` fees.


                If the fee `amount` is different from the `originalAmount`, it
                can happen for a few reasons:
                  1. The fee amount was changed and the loan was replayed. In that case, both `capitalizedAmount` and `creditedAmount` attributes are not used. This is only possible for `originationFee` or `drawFee` fees.
                  2. Part or all of the fee amount was capitalized. In that case, the capitalized amount will be represented by the `capitalizedAmount` attribute. This is only possible for `dynamicFee` fees.
                  3. Part or all of the fee amount was "covered" by a credit amount (also called `reimbursementAmount`) available on the line of credit. In that case, the credited amount will be represented by the `creditedAmount` attribute. Only applicable to lines of credit. This is only possible for `dynamicFee` fees.

                For `dynamicFee`, if `capitalizedAmount` and `creditedAmount`
                are not `null`, the follow equation should be true:

                `originalAmount - amount = capitalizedAmount + creditedAmount`
              format: float
              nullable: true
              type: number
            displayName:
              $ref: '#/components/schemas/FeeDisplayName'
            loanFeeExternalId:
              description: >
                The lender's external identifier of the loan fee object in the
                system, can also be used to cancel the fee.

                Only applicable to `type=dynamicFee` fee.
              type: string
            loanFeeId:
              description: >
                The identifier of the loan fee in the system, used to cancel a
                fee if necessary.

                Only applicable to `type=dynamicFee` fee.
              type: string
            purchaseId:
              description: >
                The ID of the line of credit draw's purchase; only relevant for
                the following fee types: `foreignTransactionFee`, `purchaseFee`.

                Only applicable to `type=dynamicFee` fee.
              type: string
            transactionId:
              description: >
                The ID of the transaction; only relevant for the following fee
                types: `nsfFee`. Only applicable to `type=dynamicFee` fee.
              type: string
          type: object
        loanId:
          $ref: '#/components/schemas/AnyId'
          description: The identifier of the loan that the fee is charged on.
        originalAmount:
          description: >
            The original fee amount is calculated as the lower of:
              - The original fee amount when the fee was charged.
              - The updated amount if "Update dynamic fee" was called and originalAmount was passed. The updated amount cannot be higher than the amount when the fee was charged.
            Sometimes fee amounts are adjusted, such as when a borrower pays off
            the fee before the statement date, as well as when the borrower has
            an overpayment in the ledger.
          format: float
          type: number
        scheduledDate:
          description: >
            The date when the fee is expected to be charged. This date is
            different from the `chargedDate` and `dueDate`.

            This date should be used only for fees in `status=scheduled`.
          format: date
          type: string
        status:
          description: >
            - `scheduled` - the fee is expected to be charged in the future.

            - `booked` - the fee was charged and is in the ledger.

            - `modified`- the fee was charged, but the amount might have changed
            since it was booked.

            - `canceled` - the fee was canceled, and the borrower is no longer
            expected to pay it.
          enum:
            - scheduled
            - booked
            - modified
            - canceled
          type: string
        timestamps:
          properties:
            createdAt:
              description: >
                The timestamp when the fee was created in the system. Created
                does not mean booked / charged.

                A fee in `scheduled` status should have `createdAt`,
                `scheduledDate` and `dueDate`, but not
                `dynamicFeeDetails.chargeDate`.

                This is because the fee is not in the ledger yet.
              format: date-time
              type: string
          type: object
        type:
          enum:
            - originationFee
            - drawFee
            - dynamicFee
          type: string
      type: object
    FeesMigrationDetails:
      description: >
        Fees migration related details. This object should be used for lines
        that are migrated from another system to Peach.

        Don't use it for installment loan migration.
      properties:
        originalDrawId:
          description: >
            The draw identifier. Can be Peach or lender's external identifier.


            All past fees prior to the "migration cutoff date" will be posted on
            the "migration" draw. After the "migration cutoff date",

            a lender can have multiple draws (e.g. Purchases, Cash Withdrawals,
            etc.). Use this attribute to indicate the original

            draw ID that the fee was posted on in another system.


            In case of fee cancellation after the "migration cutoff date", the
            `originalDrawId` will be used to adjust the draw balance.

            Fees can be posted on the line or draw level. If the
            `originalDrawId` is empty, the system will assume that the fee was

            originally charged on the line level.
          nullable: true
          pattern: ^ext-|^[A-Z][A-Z0-9]-[A-Z0-9]+-[A-Z0-9]+|^\d+$
          type: string
        originalPurchaseId:
          description: >
            The purchase identifier. Can be Peach or lender's external
            identifier. Use this attribute to indicate the original purchase ID

            that the fee was associated with in another system.


            Only applicable to the following fee types: `foreignTransactionFee`,
            `purchaseFee`. The `originalPurchaseId` must be provided

            for those fee types.
          type: string
        originalTransactionId:
          description: >
            The transaction identifier. Can be Peach or lender's external
            identifier. Use this attribute to indicate the original

            transaction ID (in `failed` status) that the fee was associated with
            in another system.


            Only applicable to the following fee types: `nsfFee`. The
            `originalTransactionId` must be provided for those fee types.
          type: string
      type: object
    LoanInvestors:
      properties:
        effectiveDate:
          description: The date at which this ownership structure came into effect.
          format: date
          type: string
        investors:
          items:
            $ref: '#/components/schemas/LoanInvestor'
          type: array
      title: Investors
      type: object
    LocChangeLoanTermsSCRAUpdate:
      properties:
        caseId:
          description: An identifier for an existing case.
          type: string
        endDate:
          description: >
            The new end date for the SCRA period. The end date is inclusive.

            Must be within the loan's lifetime, after the start date, and must
            not overlap with other SCRA plans.
          format: date
          type: string
        rateId:
          description: The public ID of the SCRA interest rate to modify.
          type: string
        sendNotice:
          default: true
          deprecated: true
          description: >
            Deprecated. This parameter is accepted for backwards compatibility
            but has no effect.

            Notices are always sent.
          type: boolean
        startDate:
          description: >
            The new start date for the SCRA period. The start date is inclusive.

            Must be within the loan's lifetime and must not overlap with other
            SCRA plans.
          format: date
          type: string
      required:
        - rateId
        - startDate
        - endDate
      type: object
    LocChangeLoanTermsSCRA:
      properties:
        annualRate:
          default: 0.06
          description: >-
            The annual interest rate for the period defined. Format is decimal.
            For example, 0.01 is 1% annual rate, 0.2 is 20% annual rate.
          format: float
          type: number
        caseId:
          description: An identifier for an existing case.
          type: string
        endDate:
          description: |
            The end date of the period. The end date is inclusive.
          format: date
          type: string
        isCancelFees:
          default: true
          description: >-
            When set to `true`, the system will waive any fees that were charged
            during the period.
          type: boolean
        sendNotice:
          default: true
          deprecated: true
          description: >
            Deprecated. This parameter is accepted for backwards compatibility
            but has no effect.

            Notices are always sent.
          type: boolean
        startDate:
          description: |
            The start date of the period. The start date is inclusive.
          format: date
          type: string
      required:
        - startDate
        - endDate
      type: object
    BasePastPeriod:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            dueDate:
              description: The period's payment due date.
              format: date
              nullable: false
              type: string
            endDate:
              description: The period end date. The end date is inclusive.
              format: date
              nullable: false
              type: string
            gracePeriod:
              nullable: true
              properties:
                fullBalanceAmount:
                  description: >
                    This attribute is only used for grace period benefit logic.

                    This amount is the full statement balance amount (also
                    called "new balance") as of the date when the obligation is

                    "sealed" (aka when `isOpen` is set to `false`).

                    Line of credit (and Draw) obligations are "sealed" on the
                    statement date.
                  format: float
                  minimum: 0
                  multipleOf: 0.01
                  nullable: true
                  type: number
                fullBalanceMinusOverdueAmount:
                  description: >
                    This attribute is only used for grace period benefit logic.

                    This amount is the full statement balance amount (also
                    called "new balance") minus any overdue amount as of the

                    date when the obligation is "sealed" (aka when `isOpen` is
                    set to `false`). Line of credit (and Draw) obligations are

                    "sealed" on the statement date.
                  format: float
                  minimum: 0
                  multipleOf: 0.01
                  nullable: true
                  type: number
                isGracePeriodEligible:
                  description: >-
                    The grace period status of the obligation period.

                    `true` - means that the period is/was eligible for the grace
                    period benefit and interest didn't accrue in the period.

                    `false` - means that the period was not eligible for the
                    grace period benefit and interest accrued in the period.
                  type: boolean
                totalFulfilledOnDueDateAmount:
                  description: >
                    This value is only used for grace period benefit logic. The
                    value will be set one calendar day after the due date.

                    The amount of the obligation for the period fulfilled by
                    service credits and borrower payments as of the end of the

                    due date. This is a sum of `fulfilledAmount` and
                    `overpaymentsAmount`.
                  format: float
                  minimum: 0
                  multipleOf: 0.01
                  nullable: true
                  type: number
              type: object
            startDate:
              description: The period start date. The start date is inclusive.
              format: date
              nullable: false
              type: string
            statementDate:
              description: >-
                The date when a statement for the period was created or should
                be created in the future.
              format: date
              nullable: false
              type: string
          type: object
    Statement:
      properties:
        creditBalanceAmount:
          description: >
            The total amount that a lender owes to the borrower.

            Note: Peach system does not allow negative balances. Use
            `creditBalanceAmount` to represent credit balance owed to the
            borrower.
          format: float
          minimum: 0
          multipleOf: 0.01
          type: number
        documentDescriptorId:
          description: |
            The statement's document descriptor ID.
          nullable: true
          type: string
        minimumAmountDue:
          description: >
            The minimum or recurring amount due for this period (also called
            obligation). This amount is a sum of interest

            accrued, fees and part of a principal. This amount does not net any
            payments or service credits made in the period.
          format: float
          minimum: 0
          multipleOf: 0.01
          type: number
        newBalanceAmount:
          description: The new balance amount for the period.
          format: float
          minimum: 0
          multipleOf: 0.01
          type: number
      type: object
    PastPeriod:
      allOf:
        - $ref: '#/components/schemas/BasePastPeriod'
        - properties:
            statement:
              $ref: '#/components/schemas/Statement'
          type: object
    StatementWithRequired:
      properties:
        creditBalanceAmount:
          description: >
            The total amount that a lender owes to the borrower.

            Note: Peach system does not allow negative balances. Use
            `creditBalanceAmount` to represent credit balance owed to the
            borrower.
          format: float
          minimum: 0
          multipleOf: 0.01
          type: number
        documentDescriptorId:
          description: |
            The statement's document descriptor ID.
          nullable: true
          type: string
        minimumAmountDue:
          description: >
            The minimum or recurring amount due for this period (also called
            obligation). This amount is a sum of interest

            accrued, fees and part of a principal. This amount does not net any
            payments or service credits made in the period.
          format: float
          minimum: 0
          multipleOf: 0.01
          type: number
        newBalanceAmount:
          description: The new balance amount for the period.
          format: float
          minimum: 0
          multipleOf: 0.01
          type: number
      required:
        - minimumAmountDue
        - newBalanceAmount
      type: object
    PastPeriodWithRequireds:
      allOf:
        - $ref: '#/components/schemas/PastPeriod'
        - properties:
            statement:
              allOf:
                - type: object
                - $ref: '#/components/schemas/StatementWithRequired'
          required:
            - startDate
            - endDate
            - statementDate
            - dueDate
            - statement
          type: object
    TransactionStatusReadOnly:
      enum:
        - scheduled
        - initiated
        - pending
        - succeeded
        - failed
        - canceled
        - inDispute
        - chargeback
      type: string
    PastTransactionMigrationDetails:
      properties:
        migration:
          description: >
            Transaction migration related details. This object:


            - Can be used only for transactions with an effective date before
            the "migration cutoff date".

            - Can be used for lines that are migrated from another system to
            Peach. Don't use it for installment loan migration.

            - Allows you to pass details on how a transaction was
            applied/allocated to draws.


            For example:


            Line of credit had three draws prior to the "migration cutoff date".
            Balances of draws were:

            - Draw A: $650

            - Draw B: $70

            - Draw B: $0


            A payment of $120 was processed. Using this object you can tell the
            system that $120 was waterfalled/allocated as following:

            - Draw A split: $70

            - Draw B split: $50

            - Draw A split: $0


            If you don't pass the `migration` object, then you won't be able to
            make the following status changes after the "migration cutoff date":

            `pending` → `failed`

            `succeeded` → `failed`
          properties:
            drawSplitDetails:
              description: >
                The transaction draw level split details are useful if the
                lender expects failures of previous successful transactions.

                When a transaction is applied on the line of credit level, it
                flows according to the payment waterfall configuration across

                multiple draws. At least one element in the `drawSplitDetails`
                array is required.
              items:
                properties:
                  drawAllocatedAmount:
                    description: >
                      The portion/split of the transaction `actualAmount` that
                      was applied/allocated to the `originalDrawId` draw. The
                      sum of all

                      `drawAllocatedAmount` must be equal to the transaction's
                      `amount`.


                      If the transaction fails after the "migration cutoff
                      date", the system will increase the applicable
                      "originalDrawId" draw's

                      non-due principal balance and replay the line.
                    format: float
                    type: number
                  originalDrawId:
                    description: >
                      The draw identifier. Can be Peach or lender's external
                      identifier.


                      All past transactions prior to the "migration cutoff date"
                      will be posted on the "migration" draw. After the
                      "migration cutoff date",

                      a lender can have multiple draws (e.g. Purchases, Cash
                      Withdrawals, etc.) Use this attribute to indicate the
                      original draw ID that

                      the transaction was posted on in another system. In case
                      of transaction failure after the "migration cutoff date",
                      the `originalDrawId`

                      will be used to increase the draw's "non-due principal"
                      balance.


                      Transactions can be posted on the line or draw level. If
                      the transaction was originally posted on the draw level,
                      choose one of the

                      post migration draws (e.g. Purchases).
                    pattern: ^ext-|^[A-Z][A-Z0-9]-[A-Z0-9]+-[A-Z0-9]+|^\d+$
                    type: string
                type: object
              type: array
          type: object
      title: Migration details
      type: object
    PastTransactionResponse:
      allOf:
        - $ref: '#/components/schemas/Transaction'
        - $ref: '#/components/schemas/PastTransactionMigrationDetails'
    PastTransactionsPaging:
      allOf:
        - $ref: '#/components/schemas/NewPaginator'
        - properties:
            data:
              items:
                $ref: '#/components/schemas/PastTransactionResponse'
              type: array
          type: object
      title: Past transactions
    BaseOneTimePaymentTransaction:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            actualAmount:
              description: |
                The actual amount that was processed. The system never debits
                more than the loan outstanding balance.
              readOnly: true
              type: number
            amount:
              description: |
                The amount of the payment.
              format: float
              minimum: 0
              type: number
              writeOnly: true
            createdBy:
              description: >
                Identifier of the user responsible for creating the transaction.

                Can be a borrower, service agent or automated system process
                (such as Autopay).
              readOnly: true
              type: integer
            customDisplayName:
              description: >
                A friendly description of the transaction. If provided, this
                value will be displayed in Peach UI/App and Statements 

                (or can be used by lender in their App). If the value is not
                provided, the Peach UI/App and Statements logic will 

                render the transaction name based on type and status. Make sure
                you provide value that makes sense to the borrower.

                This is NOT what the borrower will see in their online bank or
                card account.
              nullable: true
              type: string
            evidenceDocumentId:
              allOf:
                - $ref: '#/components/schemas/AnyId'
                - description: >
                    The document ID of a one-time payment consent screenshot

                    captured when a borrower made the payment.  Only applicable
                    when

                    Peach App is used and company's

                    `config.evidence.captureScreenshot=true`.
            externalId:
              $ref: '#/components/schemas/externalId'
              description: A lender's identifier for a transaction.
            failureReason:
              description: >-
                The transaction failure reason. This value is ignored except
                when creating an external transaction with `status=failed`
              enum:
                - insufficientFunds
                - chargeback
                - accountClosed
                - invalidAccount
                - unknownReason
                - invalidCvv
                - invalidExpirationDate
                - avsFailed
                - networkError
                - cardDeclined
                - accountFrozen
                - deceased
                - invalidRouting
                - paymentStopped
                - incorrectNumber
                - fraudulent
                - unauthorizedDebit
              type: string
            paymentInstrumentId:
              $ref: '#/components/schemas/AnyId'
              description: The payment instrument identifier that was charged.
            scheduledAmount:
              description: >
                The scheduled amount. The actual amount charged can be lower
                from the

                scheduled amount. It cannot be higher.
              readOnly: true
              type: number
            type:
              enum:
                - oneTime
              type: string
              writeOnly: true
          required:
            - amount
            - type
          type: object
      title: One Time Payment
    PastTransactionCreationStatus:
      description: >
        The transaction status. May only be passed when `isExternal=true`.


        External transactions can be created in: `scheduled`, `initiated`,
        `pending`, `succeeded`, or `failed`.

        External transactions are applied to the loan balance immediately when
        created with status `initiated`, `pending`, or `succeeded`. Otherwise,

        they will be applied the first time they are updated to one of these
        statuses.


        `initiated` - payment was initiated and sent to a payment processor. The
        payment is applied to a loan. This status is used normally for ACH.


        `pending` - payment was acknowledged by the payment processor and is
        being processed. For ACH the payment can be in pending status for a few
        days.


        `succeeded` - payment was completed successfully.


        `failed` - payment failed and was removed from the loan effective as of
        `initiated`, `pending` or `succeeded` status effective date. The system
        replays the loan as if the payment never happened.

        It will also re-accrue interest since then.


        `inDispute` - payment is in dispute (typically because of chargeback).
        The payment is removed from the loan effective as of `initiated`,
        `pending` or `succeeded` status effective date. The system replays the
        loan as if the payment never happened.

        It will also re-accrue interest since then. Disputed payment can be for
        partial amount.


        `canceled` - payment or credit was canceled. Payment can be canceled
        only if the current status is `scheduled`.


        `chargeback` - payment was disputed and ruled against the lender. The
        payment was returned to the original payment instrument. Chargeback
        payment can be for partial amount.
      enum:
        - initiated
        - pending
        - succeeded
        - failed
        - canceled
        - inDispute
        - chargeback
      type: string
    BasePastTransaction:
      allOf:
        - properties:
            effectiveDate:
              description: >
                This attribute can be used only during the migration process of
                loans from another system to Peach. Any value passed for
                `active` loans will be ignored.


                The effective date of the transaction in the product timezone.
                Set `effectiveDateTimeInUtc` to `true` to interpret as UTC
                instead. This attribute can be used for transactions with
                `isExternal=true` only.

                The date must be in the past or today. Make sure to provide
                `effectiveTimeOfDay` also.
              format: date
              type: string
            effectiveDateTimeInUtc:
              default: false
              description: >
                When `true`, `effectiveDate` and `effectiveTimeOfDay` are
                interpreted as UTC

                rather than the product timezone. This avoids ambiguity during
                DST transitions.
              type: boolean
            effectiveTimeOfDay:
              allOf:
                - $ref: '#/components/schemas/TimeOfDay'
                - description: >
                    The effective time of day on `effectiveDate` in the product
                    timezone. Set `effectiveDateTimeInUtc` to `true` to
                    interpret as UTC instead. This attribute can be used for
                    transactions with `isExternal=true` only. Required if
                    `effectiveDate` is passed.


                    Note: for migration only, the value must be after 2AM in the
                    product timezone.
                  type: object
                  writeOnly: true
            paymentInstrumentDetails:
              description: >
                Payment instrument details are only allowed to be passed for
                migrated lines of credit. This allows you to create transactions

                without the need to create a payment instrument object first. If
                the `paymentInstrumentDetails` is passed, the system will not

                require `paymentInstrumentId`. Instead, the system will
                automatically create a payment instrument behind the scenes.

                The instrument will be created as
                `instrumentType=paymentNetwork` and mainly used to be displayed
                in the Borrower Portal or an

                App. The instrument cannot be used for any future transactions
                after the migration.
              properties:
                accountLastFour:
                  description: >
                    The last four digits of the payment instrument, check
                    number, wire number, money order serial number or custom.
                  maxLength: 4
                  minLength: 4
                  nullable: true
                  type: string
                customDisplayName:
                  description: >
                    Required only if `instrumentType=custom`. The system will
                    show the payment method as `{customerDisplayName}
                    *{accountLastFour}`.

                    The `customerDisplayName` will be adjusted automatically to
                    uppercase. If the `accountLastFour` is not passed, the
                    system will only

                    show the `{customerDisplayName}`.


                    Example 1:
                      instrumentType = custom
                      customerDisplayName = Cash
                      accountLastFour = empty
                      Displayed as: `CASH`

                    Example 2:
                      instrumentType = bankAccount
                      accountLastFour = 8892
                      Displayed as: `BANK ACCOUNT *8892`

                    Example 3:
                      instrumentType = debitCard
                      accountLastFour = 7098
                      Displayed as: `DEBIT CARD *7098`
                  nullable: true
                  type: string
                type:
                  description: The instrument type.
                  enum:
                    - bankAccount
                    - creditCard
                    - debitCard
                    - check
                    - payroll
                    - moneyOrder
                    - wire
                    - custom
                  type: string
              type: object
          required:
            - effectiveDate
            - effectiveTimeOfDay
          type: object
        - $ref: '#/components/schemas/PastTransactionMigrationDetails'
      title: Base Past Transaction
    PastTransactionOneTimePayment:
      allOf:
        - $ref: '#/components/schemas/BaseOneTimePaymentTransaction'
        - properties:
            status:
              $ref: '#/components/schemas/PastTransactionCreationStatus'
          required:
            - status
          type: object
        - $ref: '#/components/schemas/BasePastTransaction'
      title: One Time Payment
    BaseServiceCreditTransaction:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            actualAmount:
              description: |
                The actual amount that was processed. The system never debits
                more than the loan outstanding balance.
              format: float
              readOnly: true
              type: number
            amount:
              description: |
                The amount to credit the borrower's balance.
              format: float
              minimum: 0
              type: number
              writeOnly: true
            createdBy:
              description: >
                Identifier of the user responsible for creating the transaction.

                Can be a borrower, service agent or automated system process
                (such as Autopay).
              readOnly: true
              type: integer
            customDisplayName:
              description: >
                A friendly description of the transaction. If provided, this
                value will be displayed in Peach UI/App and Statements 

                (or can be used by lender in their App). If the value is not
                provided, the Peach UI/App and Statements logic will 

                render the transaction name based on type and status. Make sure
                you provide value that makes sense to the borrower.

                This is NOT what the borrower will see in their online bank or
                card account.
              nullable: true
              type: string
            externalId:
              $ref: '#/components/schemas/externalId'
            scheduledAmount:
              description: >
                The scheduled amount. The actual amount charged can be lower
                from the

                scheduled amount. It cannot be higher.
              format: float
              readOnly: true
              type: number
            serviceCreditSponsor:
              description: >
                Sponsor of the credit. Mainly used for ledger/accounting.


                If `loanOwner`, the credit is recorded as expense in
                ledger/accounting.


                If `loanServicer`, the credit is recorded as liability from the
                servicer.


                If `merchant`, the credit is recorded as liability from the
                merchant.
              enum:
                - loanOwner
                - loanServicer
                - merchant
              type: string
            serviceCreditType:
              $ref: '#/components/schemas/serviceCreditTypes'
              description: >-
                Type of the credit. Credit types are recorded differently in
                ledger/accounting.
            status:
              description: >
                The transaction status.


                `scheduled` - payment or credit was scheduled for a future date
                that has not arrived yet. The payment has not applied to a loan
                yet.


                `initiated` - payment was initiated and sent to a payment
                processor. The payment is applied to a loan. This status is used
                normally for ACH.


                `pending` - payment was acknowledged by the payment processor
                and is being processed. For ACH the payment can be in pending
                status for a few days.


                `succeeded` - payment was completed successfully.


                `failed` - payment failed and was removed from the loan
                effective as of `initiated`, `pending` or `succeeded` status
                effective date. The system replays the loan as if the payment
                never happened.

                It will also re-accrue interest since then.


                `inDispute` - payment is in dispute (typically because of
                chargeback). The payment is removed from the loan effective as
                of `initiated`, `pending` or `succeeded` status effective date.
                The system replays the loan as if the payment never happened.

                It will also re-accrue interest since then. Disputed payment can
                be for partial amount.


                `canceled` - payment or credit was canceled. Payment can be
                canceled only if the current status is `scheduled`.


                `chargeback` - payment was disputed and ruled against the
                lender. The payment was returned to the original payment
                instrument. Chargeback payment can be for partial amount.
              enum:
                - scheduled
                - initiated
                - pending
                - succeeded
                - failed
                - canceled
                - inDispute
                - chargeback
              readOnly: true
              type: string
            timestamps:
              description: Timestamps of the transaction statuses.
              properties:
                canceledAt:
                  format: date-time
                  type: string
                chargebackAt:
                  format: date-time
                  type: string
                effectiveDate:
                  format: date
                  type: string
                failedAt:
                  format: date-time
                  type: string
                inDisputeAt:
                  format: date-time
                  type: string
                initiatedAt:
                  format: date-time
                  type: string
                pendingAt:
                  format: date-time
                  type: string
                scheduledDate:
                  format: date
                  type: string
                succeededAt:
                  format: date-time
                  type: string
              readOnly: true
              type: object
            type:
              enum:
                - service
              type: string
              writeOnly: true
          required:
            - amount
            - type
            - serviceCreditType
            - serviceCreditSponsor
          type: object
      title: Service Credit
    PastTransactionServiceCredit:
      allOf:
        - $ref: '#/components/schemas/BaseServiceCreditTransaction'
        - $ref: '#/components/schemas/BasePastTransaction'
      title: Service Credit
    BaseDownPaymentTransaction:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            actualAmount:
              description: |
                The actual amount that was processed. The system never debits
                more than the loan outstanding balance.
              readOnly: true
              type: number
            amount:
              description: |
                The amount of the payment.
              format: float
              minimum: 0
              type: number
              writeOnly: true
            createdBy:
              description: >
                Identifier of the user responsible for creating the transaction.

                Can be a borrower, service agent or automated system process
                (such as Autopay).
              readOnly: true
              type: integer
            customDisplayName:
              description: >
                A friendly description of the transaction. If provided, this
                value will be displayed in Peach UI/App and Statements 

                (or can be used by lender in their App). If the value is not
                provided, the Peach UI/App and Statements logic will 

                render the transaction name based on type and status. Make sure
                you provide value that makes sense to the borrower.

                This is NOT what the borrower will see in their online bank or
                card account.
              nullable: true
              type: string
            externalId:
              $ref: '#/components/schemas/externalId'
              description: A lender's identifier for a transaction.
            paymentInstrumentId:
              $ref: '#/components/schemas/AnyId'
              description: The payment instrument identifier that was charged.
            scheduledAmount:
              description: >
                The scheduled amount. The actual amount charged can be lower
                from the

                scheduled amount. It cannot be higher.
              readOnly: true
              type: number
            type:
              enum:
                - downPayment
              type: string
              writeOnly: true
          required:
            - amount
            - type
          type: object
      title: Down Payment
    PastTransactionDownPayment:
      allOf:
        - $ref: '#/components/schemas/BaseDownPaymentTransaction'
        - properties:
            status:
              $ref: '#/components/schemas/PastTransactionCreationStatus'
          required:
            - status
          type: object
        - $ref: '#/components/schemas/BasePastTransaction'
      title: Down Payment
    PastTransaction:
      oneOf:
        - $ref: '#/components/schemas/PastTransactionOneTimePayment'
        - $ref: '#/components/schemas/PastTransactionServiceCredit'
        - $ref: '#/components/schemas/PastTransactionDownPayment'
    BasePastTransactionForUpdate:
      allOf:
        - properties:
            effectiveDate:
              description: >
                This attribute can be used only during the migration process of
                loans from another system to Peach. Any value passed for
                `active` loans will be ignored.


                The effective date of the transaction in the product timezone.
                Set `effectiveDateTimeInUtc` to `true` to interpret as UTC
                instead. This attribute can be used for transactions with
                `isExternal=true` only.

                The date must be in the past or today. Make sure to provide
                `effectiveTimeOfDay` also.
              format: date
              type: string
            effectiveDateTimeInUtc:
              default: false
              description: >
                When `true`, `effectiveDate` and `effectiveTimeOfDay` are
                interpreted as UTC

                rather than the product timezone. This avoids ambiguity during
                DST transitions.
              type: boolean
            effectiveTimeOfDay:
              allOf:
                - $ref: '#/components/schemas/TimeOfDay'
                - description: >
                    The effective time of day on `effectiveDate` in the product
                    timezone. Set `effectiveDateTimeInUtc` to `true` to
                    interpret as UTC instead. This attribute can be used for
                    transactions with `isExternal=true` only. Required if
                    `effectiveDate` is passed.


                    Note: for migration only, the value must be after 2AM in the
                    product timezone.
                  type: object
                  writeOnly: true
            paymentInstrumentDetails:
              description: >
                Payment instrument details are only allowed to be passed for
                migrated lines of credit. This allows you to create transactions

                without the need to create a payment instrument object first. If
                the `paymentInstrumentDetails` is passed, the system will not

                require `paymentInstrumentId`. Instead, the system will
                automatically create a payment instrument behind the scenes.

                The instrument will be created as
                `instrumentType=paymentNetwork` and mainly used to be displayed
                in the Borrower Portal or an

                App. The instrument cannot be used for any future transactions
                after the migration.
              properties:
                accountLastFour:
                  description: >
                    The last four digits of the payment instrument, check
                    number, wire number, money order serial number or custom.
                  maxLength: 4
                  minLength: 4
                  nullable: true
                  type: string
                customDisplayName:
                  description: >
                    Required only if `instrumentType=custom`. The system will
                    show the payment method as `{customerDisplayName}
                    *{accountLastFour}`.

                    The `customerDisplayName` will be adjusted automatically to
                    uppercase. If the `accountLastFour` is not passed, the
                    system will only

                    show the `{customerDisplayName}`.


                    Example 1:
                      instrumentType = custom
                      customerDisplayName = Cash
                      accountLastFour = empty
                      Displayed as: `CASH`

                    Example 2:
                      instrumentType = bankAccount
                      accountLastFour = 8892
                      Displayed as: `BANK ACCOUNT *8892`

                    Example 3:
                      instrumentType = debitCard
                      accountLastFour = 7098
                      Displayed as: `DEBIT CARD *7098`
                  nullable: true
                  type: string
                type:
                  description: The instrument type.
                  enum:
                    - bankAccount
                    - creditCard
                    - debitCard
                    - check
                    - payroll
                    - moneyOrder
                    - wire
                    - custom
                  type: string
              type: object
          type: object
        - $ref: '#/components/schemas/PastTransactionMigrationDetails'
      title: Update Past Transaction
    PastTransactionUpdate:
      allOf:
        - $ref: '#/components/schemas/BasePastTransactionForUpdate'
        - properties:
            amount:
              description: |
                The amount of the payment.
              format: float
              minimum: 0
              type: number
            externalId:
              $ref: '#/components/schemas/externalId'
            failureReason:
              $ref: '#/components/schemas/TransactionFailureReason'
            status:
              $ref: '#/components/schemas/PastTransactionCreationStatus'
          type: object
    LOCMigrationBalances:
      description: >
        The balances passed here should be as of the "migration cutoff date"
        after the most recent statement was generated in your legal system.


        For example:

        - Migration period:
          - startDate: Aug 1, 2024
          - endDate: Aug 31, 2024
          - statementDate: Sep 1, 2024
          - dueDate: Sep 22, 2024
        - Previous period (also called "past period"):
          - startDate: Jul 1, 2024
          - endDate: Jul 31, 2024
          - statementDate: Aug 1, 2024
          - dueDate: Aug 22, 2024
        - Notes:
          - The balances should be as of Aug 1, 2024 after the statement was generated on Aug 1, 2024.
      properties:
        creditLimitAmount:
          description: |
            The line credit limit amount as of the "migration cutoff date".
          format: float
          minimum: 0
          multipleOf: 0.01
          type: number
        dueBalances:
          description: >
            Due balances represent balances that are currently due.

            Only fees can be passed inside the balance objects on LOC level.

            All other balances are expected to be passed in the `Create
            migration period draw data` endpoint.
          properties:
            dueLateFeesAmount:
              description: The late fees portion of `dueFeesAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
            dueOriginationFeesAmount:
              description: The origination fees portion of `dueFeesAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
          required:
            - dueOriginationFeesAmount
            - dueLateFeesAmount
          type: object
        nonDueBalances:
          description: >
            Non-due balances represent balances that are not yet due.

            Only fees can be passed inside the balance objects on LOC level.

            All other balances are expected to be passed in the `Create
            migration period draw data` endpoint.
          properties:
            nonDueLateFeesAmount:
              description: The late fees portion of `nonDueFeesAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
            nonDueOriginationFeesAmount:
              description: The origination fees portion of `nonDueFeesAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
          required:
            - nonDueOriginationFeesAmount
            - nonDueLateFeesAmount
          type: object
        overdueBalances:
          description: >
            Overdue balances represent balances that are overdue.

            Only fees can be passed inside the balance objects on LOC level.

            All other balances are expected to be passed in the `Create
            migration period draw data` endpoint.
          properties:
            overdueLateFeesAmount:
              description: The late fees portion of `overdueFeesAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
            overdueOriginationFeesAmount:
              description: The origination fees portion of `overdueFeesAmount`.
              format: float
              minimum: 0
              multipleOf: 0.01
              type: number
          required:
            - overdueOriginationFeesAmount
            - overdueLateFeesAmount
          type: object
        reimbursementAmount:
          description: >
            The total amount that a lender owes to the borrower as of the
            "migration cutoff date".
          format: float
          minimum: 0
          multipleOf: 0.01
          type: number
      required:
        - nonDueBalances
        - dueBalances
        - overdueBalances
        - creditLimitAmount
        - reimbursementAmount
      type: object
    LOCMigrationGracePeriod:
      allOf:
        - $ref: '#/components/schemas/BaseMigrationGracePeriod'
        - description: >
            If you are not migrating past periods and the migration period is
            the first period of the LOC:


            Don't pass the `gracePeriod` object.


            If you are migrating past periods:


            This is the entire LOC grace period details including all its draws.


            The grace period data passed here corresponds to the previous period
            and not to the migration period. By the time you call this endpoint,
            you should have already created one or more past periods. The
            additional data that you pass here is only required for the previous
            period and not for all past periods. That's why the grace period
            data is part of the "Create migration period LOC data" vs "Create
            past periods data" endpoint.


            The migration period is a "live" period in which you execute
            migration.
              - Because the Peach system needs to know if the LOC is eligible for the grace period benefit when the migration period starts, the system
                will use the `isGracePeriodEligible` passed here. If you pass `isGracePeriodEligible=true`, the system will start migration without
                accruing interest in the "migration period". If you pass `isGracePeriodEligible=false`, the system will start migration with accruing
                interest in the "migration period".
              - On the "due date + 1" within the "migration period", the system evaluates the grace eligibility based on `fullBalanceAmount`, `fullBalanceMinusOverdueAmount` and payments made.
              - If you migrate the LOC before the upcoming "due date", the system will evaluate the grace period eligibility in "live" and might revoke the benefit.
              - If you migrate the LOC after the "due date", the system will evaluate the grace period eligibility as part of the "replay/migration" process.
                Because of existing limitations with "replay", grace period eligibility cannot be revoked as part of the replay process. However, the replay
                process can reinstate the grace period benefit (in other words, waive accrued interest from the start of the "migration period").
              - Peach is responsible for generating the statement corresponding to the migration period on `migrationPeriod.statementDate` in the future.
                The grace period details of the migration period will be calculated by the Peach system on `migrationPeriod.statementDate` in the future.

            For example:

            - Migration period:
              - startDate: Aug 1, 2024
              - endDate: Aug 31, 2024
              - statementDate: Sep 1, 2024
              - dueDate: Sep 22, 2024
            - Previous period (also called "past period"):
              - startDate: Jul 1, 2024
              - endDate: Jul 31, 2024
              - statementDate: Aug 1, 2024
              - dueDate: Aug 22, 2024
            Notes:
              - The grace period details that you need to pass correspond to the previous period that started on Jul 1, 2024 and ended on Jul 31, 2024.
              - The amounts and values should be as of the "migration cutoff date", Aug 1, 2024, after the statement was finalized in your legacy system.
          type: object
    MigrationPeriod:
      description: >
        The migration period.

        The "migration cutoff date" will be set to the `startDate` passed here.
        It's important to understand that `migrationPeriod.statementDate` and
        `migrationPeriod.dueDate` are future dates. The previous period's
        `dueDate` is also a future date (relative to when you execute the
        migration) and falls in the "migration period".


        For example:

        - Migration period:
          - startDate: Aug 1, 2024
          - endDate: Aug 31, 2024
          - statementDate: Sep 1, 2024
          - dueDate: Sep 22, 2024
        - Previous period (also called "past period"):
          - startDate: Jul 1, 2024
          - endDate: Jul 31, 2024
          - statementDate: Aug 1, 2024
          - dueDate: Aug 22, 2024
        Notes:
          - "Migration cutoff date" is Aug 1, 2024.
          - If you execute the migration on Aug 10, 2024, the "migration at date" is Aug 10.
          - Previous period's `dueDate`, Aug 22, 2024, falls in the "migration period" that starts on Aug 1, 2024 and ends on Aug 31, 2024.
          - The upcoming due date is Aug 22, 2024.
          - If you didn't complete the migration before Aug 22, 2024, you need to cancel the loan and start the process again.
      properties:
        dueDate:
          format: date
          nullable: false
          type: string
        endDate:
          format: date
          nullable: false
          type: string
        id:
          readOnly: true
          type: string
        object:
          default: loanPeriod
          enum:
            - loanPeriod
          readOnly: true
          type: string
        startDate:
          format: date
          nullable: false
          type: string
        statementDate:
          format: date
          nullable: false
          type: string
      required:
        - startDate
        - endDate
        - statementDate
        - dueDate
      type: object
    LOCMigrationObligation:
      allOf:
        - description: >
            If you are not migrating past periods and the migration period is
            the first period of the LOC:


            Don't pass the `obligation` object.


            If you are migrating past periods:


            This is the LOC level obligation details only (excluding any draws).


            The data passed here corresponds to the previous period and not to
            the migration period. By the time you call this endpoint, you
            should've already created one or more past periods. The additional
            data that you pass here is only required for the previous period and
            not for all past periods. That's why the additional obligation data
            is part of the "Create migration period LOC data" vs "Create past
            periods data" endpoint.


            To remind, the migration period is a "live" period in which you
            execute migration. The obligation details of the migration period
            will be calculated by the Peach system. Peach is also responsible
            for generating the statement corresponding to the migration period
            on `migrationPeriod.statementDate` in the future.


            For example:
              - Migration period:
                - startDate: Aug 1, 2024
                - endDate: Aug 31, 2024
                - statementDate: Sep 1, 2024
                - dueDate: Sep 22, 2024
              - Previous period (also called "past period"):
                - startDate: Jul 1, 2024
                - endDate: Jul 31, 2024
                - statementDate: Aug 1, 2024
                - dueDate: Aug 22, 2024
              - Notes:
                - The obligation details that you need to pass correspond to the previous period that started on Jul 1, 2024 and ended on Jul 31, 2024.
                - The amounts and other values should be as of the "migration cutoff date", Aug 1, 2024, after the statement was finalized in your legacy system.
          properties:
            migratedDaysOverdue:
              $ref: '#/components/schemas/MigratedDaysOverdue'
            migratedOverdueFromDate:
              description: >
                The date from which the account is overdue at the time of
                migration. This attribute will also

                be used to calculate "Date Of First Delinquency" for credit
                bureaus reporting.


                If `migratedDaysOverdue > 0`, then `migratedOverdueFromDate` is
                required.
              format: date
              nullable: true
              type: string
            obligationAmount:
              description: >
                The remaining amount of the previous period's obligation that a
                borrower needs to pay on the due date that comes after
                "migration cutoff date". The remaining amount should be as of
                "migration cutoff date" vs. "migration at date".


                This is the LOC level remaining obligation amount excluding any
                draws' obligation amounts. Only fees can be passed inside the
                balance objects on LOC level. All other balances are expected to
                be passed in the `Create migration period draw data` endpoint.


                If your LOC (or credit card) product doesn't count payments that
                were made before the statement date towards the statement
                minimum amount, then `obligationAmount` must be always equal to
                the LOC level portion of the whole statement minimum amount.


                Example:
                  - Migration period:
                    - startDate: Aug 1, 2024
                    - endDate: Aug 31, 2024
                    - statementDate: Sep 1, 2024
                    - dueDate: Sep 22, 2024
                  - Previous period (also called "past period"):
                    - startDate: Jul 1, 2024
                    - endDate: Jul 31, 2024
                    - statementDate: Aug 1, 2024
                    - dueDate: Aug 22, 2024

                Scenario 1:
                  - A late fee of $15 was charged in the previous period on Jul 23, 2024 (on the LOC level). This fee is due on Aug 22, 2024. 
                  - A borrower made some payments in the previous period, and based on your waterfall configuration in the legacy system, $5 out of $15 of the late fee was paid.
                  - The remaining fee amount of $10 is due on Aug 22, 2024.
                  - You should pass `obligationAmount=10`.

                Scenario 2:
                  - A late fee of $15 was charged in the previous period on Jul 23, 2024 (on LOC level). This fee is due on Aug 22, 2024. 
                  - A borrower made some payments in the previous period, and based on your waterfall configuration in the legacy system, none of the payments were counted toward the $15 late fee.
                  - The late fee amount of $15 is due on Aug 22, 2024.
                  - You should pass `obligationAmount=15`.

                Scenario 3:
                  - A late fee of $15 was charged in the previous period on Jul 23, 2024 (on LOC level). This fee is due on Aug 22, 2024. 
                  - A borrower made early payments in the previous period, and based on your waterfall configuration in the legacy system, the payments were counted toward the $15 late fee.
                  - The remaining fee amount of $0 is due on Aug 22, 2024 (in other words, the borrower doesn't need to pay anything on Aug 22, 2024.)
                  - You should pass `obligationAmount=0`.
              format: float
              minimum: 0
              multipleOf: 0.01
              nullable: false
              type: number
          required:
            - obligationAmount
            - migratedDaysOverdue
          type: object
    MigrationPeriodLOCData:
      properties:
        balances:
          $ref: '#/components/schemas/LOCMigrationBalances'
        gracePeriod:
          $ref: '#/components/schemas/LOCMigrationGracePeriod'
        migrationPeriod:
          $ref: '#/components/schemas/MigrationPeriod'
        obligation:
          $ref: '#/components/schemas/LOCMigrationObligation'
        paidOffDate:
          description: >
            The date the line was paid off in another system (not in Peach).
            Required only when

            `postMigrationLoanStatus=paidOff`. The value must be after the line
            activation date and before the

            migration cutoff date. Not allowed when `postMigrationLoanStatus` is
            not `paidOff`.
          format: date
          nullable: false
          type: string
        postMigrationLoanChargedOffReason:
          description: >
            The reason for the line charge off. Only required if
            `migrationStatus=chargedOff`.

            - `term` means the loan was charged off per loan type configuration
            after X days overdue.

            - `fraudulent` means the loan was charged off for a fraudulent
            reason.

            - `bankruptcy` means the loan was charged off because of bankruptcy.

            - `legal` means the loan was charged off because of some legal
            reason.
          enum:
            - term
            - fraudulent
            - bankruptcy
            - legal
          nullable: true
          type: string
        postMigrationLoanStatus:
          default: active
          description: >
            The status of the line after a successful migration.

            If you pass `accelerated` or `chargedOff`, the system will first
            migrate the line as "active" and then

            immediately accelerate or charge off the line and its draws. The
            `effectiveDate` of the acceleration

            or charge off will be equal to the "migration cutoff date".

            If you pass `paidOff`, the line is migrated as a static line that
            can never transition to any other status.

            Do not pass `obligation`, `gracePeriod`, or `balances` when
            `postMigrationLoanStatus` is `paidOff`.
          enum:
            - active
            - accelerated
            - chargedOff
            - paidOff
          type: string
      type: object
    MigrationPeriodLOCDataResponse:
      allOf:
        - $ref: '#/components/schemas/SingletonResponse'
        - properties:
            data:
              allOf:
                - $ref: '#/components/schemas/MigrationPeriodLOCData'
                - properties:
                    migratedOverdueAmount:
                      format: float
                      nullable: true
                      type: number
                  type: object
          type: object
    MigrationPeriodLOCDataPaidOffWithRequired:
      properties:
        migrationPeriod:
          $ref: '#/components/schemas/MigrationPeriod'
        paidOffDate:
          format: date
          type: string
        postMigrationLoanStatus:
          enum:
            - paidOff
          type: string
      required:
        - migrationPeriod
        - paidOffDate
        - postMigrationLoanStatus
      type: object
    MigrationPeriodLOCDataActiveWithRequired:
      allOf:
        - $ref: '#/components/schemas/MigrationPeriodLOCData'
        - required:
            - migrationPeriod
            - obligation
            - gracePeriod
            - balances
          type: object
    MigrationPeriodLOCDataWithRequired:
      oneOf:
        - $ref: '#/components/schemas/MigrationPeriodLOCDataPaidOffWithRequired'
        - $ref: '#/components/schemas/MigrationPeriodLOCDataActiveWithRequired'
    ObligationLoanGracePeriod:
      description: >
        Loan's grace period details. Only Loans created with
        `isGracePeriodEligible=true` will populate details in this object.

        See `gracePeriod` object for Draw-specific grace period details.
      nullable: true
      properties:
        fullBalanceAmount:
          description: >
            This attribute is only used for grace period benefit logic.

            This amount is the full statement balance amount (also called "new
            balance") as of the date when the obligation is

            "sealed" (aka when `isOpen` is set to `false`).

            Line of credit (and Draw) obligations are "sealed" on the statement
            date.
          format: float
          nullable: true
          type: number
        fullBalanceMinusOverdueAmount:
          description: >
            This attribute is only used for grace period benefit logic.

            This amount is the full statement balance amount (also called "new
            balance") minus any overdue amount as of the

            date when the obligation is "sealed" (aka when `isOpen` is set to
            `false`). Line of credit (and Draw) obligations are

            "sealed" on the statement date.
          format: float
          nullable: true
          type: number
        isGracePeriodEligible:
          description: >-
            The grace period status of the obligation period.

            `true` - means that the period is/was eligible for the grace period
            benefit and interest didn't accrue in the period.

            `false` - means that the period was not eligible for the grace
            period benefit and interest accrued in the period.
          type: boolean
        totalFulfilledOnDueDateAmount:
          description: >
            This value is only used for grace period benefit logic. The value
            will be set one calendar day after the due date.

            The amount of the obligation for the period fulfilled by service
            credits and borrower payments as of the end of the

            due date. This is a sum of `fulfilledAmount` and
            `overpaymentsAmount`.
          format: float
          nullable: true
          type: number
      type: object
    LOCObligationResult:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - $ref: '#/components/schemas/ObligationAmountFields'
        - $ref: '#/components/schemas/ObligationOtherFields'
        - properties:
            gracePeriod:
              anyOf:
                - description: >
                    Draws' grace period details. Only draws that were created
                    with `isGracePeriodEligible=true` will be included in the
                    list.
                  items:
                    allOf:
                      - properties:
                          drawId:
                            description: The draw identifier.
                            type: string
                        type: object
                      - $ref: '#/components/schemas/ObligationGracePeriod'
                  nullable: true
                  type: array
                - $ref: '#/components/schemas/ObligationGracePeriod'
            loanGracePeriod:
              $ref: '#/components/schemas/ObligationLoanGracePeriod'
          type: object
    LOCObligationsResult:
      allOf:
        - $ref: '#/components/schemas/IsLocked'
        - properties:
            daysOverdue:
              description: >
                Number of calendar days overdue starting from the due date of
                the earliest overdue obligation to

                the current date.
              type: integer
            isOverdue:
              description: |
                `true` if the borrower has any obligation overdue on the loan.
              type: boolean
            obligations:
              items:
                $ref: '#/components/schemas/LOCObligationResult'
              type: array
            overdueAmount:
              description: |
                The total overdue amount across all obligations on the loan.
              format: float
              type: number
          type: object
    LoanChangeLoanTerms:
      allOf:
        - $ref: '#/components/schemas/DueDatesRequest'
        - properties:
            duration:
              description: >
                The remaining duration - in months starting from the current day
                - under the new payment plan.
              type: integer
            recurringAmount:
              description: |
                The requested recurring amount under the new payment plan.
              format: float
              type: number
          type: object
        - $ref: '#/components/schemas/CaseId'
    schemas-SendNoticeCancelAutopay:
      default: true
      description: >
        When set to `false`, the system will NOT send a
        `loanPaymentScheduleChanged` notice to the borrower.
      type: boolean
    LoanChangeLoanTermsSCRAUpdate:
      properties:
        caseId:
          description: An identifier for an existing case.
          type: string
        endDate:
          description: >
            The new end date for the SCRA period. The end date is inclusive.

            Must be within the loan's lifetime, after the start date, and must
            not overlap with other SCRA plans.
          format: date
          type: string
        rateId:
          description: The public ID of the SCRA interest rate to modify.
          type: string
        sendNotice:
          $ref: '#/components/schemas/schemas-SendNoticeCancelAutopay'
        startDate:
          description: >
            The new start date for the SCRA period. The start date is inclusive.

            Must be within the loan's lifetime and must not overlap with other
            SCRA plans.
          format: date
          type: string
      required:
        - rateId
        - startDate
        - endDate
      type: object
    LoanChangeLoanTermsSCRA:
      properties:
        annualRate:
          default: 0.06
          description: >-
            The annual interest rate for the period defined. Format is decimal.
            For example, 0.01 is 1% annual rate, 0.2 is 20% annual rate.
          format: float
          type: number
        caseId:
          description: An identifier for an existing case.
          type: string
        endDate:
          description: |
            The end date of the period. The end date is inclusive.
          format: date
          type: string
        isCancelFees:
          default: true
          description: >-
            When set to `true`, the system will waive any fees that were charged
            during the period.
          type: boolean
        sendNotice:
          $ref: '#/components/schemas/schemas-SendNoticeCancelAutopay'
        startDate:
          description: |
            The start date of the period. The start date is inclusive.
          format: date
          type: string
      required:
        - startDate
        - endDate
      type: object
    LoanPeriod:
      properties:
        dueDate:
          description: The period's payment due date in the product timezone.
          format: date
          type: string
        endDate:
          description: >-
            The period end date in the product timezone. The end date is
            inclusive.
          format: date
          type: string
        id:
          description: The period identifier.
          type: string
        startDate:
          description: >-
            The period start date in the product timezone. The start date is
            inclusive.
          format: date
          type: string
        statementDate:
          description: >-
            The date when a statement for the period was created or should be
            created in the future.
          format: date
          type: string
      type: object
    LoanPeriodsPaging:
      properties:
        data:
          items:
            $ref: '#/components/schemas/LoanPeriod'
          type: array
      type: object
    ProcessingCompleteGeneric:
      properties:
        processingComplete:
          description: >
            Only returned when query parameter `sync` is set to `true`.
            Indicates if the extra processing has finished yet.

            If it is not done in 20 seconds, the request will return and this
            value will be set to `false`.
          type: boolean
      type: object
    StatementSharedFields:
      properties:
        billingCycleEndDate:
          description: >-
            The end date of the statement billing cycle. This date is in the
            product timezone.
          format: date
          type: string
        billingCycleStartDate:
          description: >-
            The start date of the statement billing cycle. This date is in the
            product timezone.
          format: date
          type: string
        documentDescriptorId:
          description: >
            The statement's document descriptor ID. To get the actual document,
            use the "Download document content" endpoint.
          type: string
        isExternal:
          description: >
            If `true`, it means that the statement was originally calculated and
            created in another system (not in Peach) and

            uploaded to the Peach system. Statements with `isExternal=true`
            might not have all statement details data.

            You must upload a PDF version of the statement. Statements that are
            marked as `isExternal=true` cannot

            be regenerated by Peach. The system will return an error if the
            regenerate statement endpoint

            is called for a statement with `isExternal=true` value.


            If `false`, it means that the statement was originally calculated
            and created by the Peach system.


            Used in Line of Credit migration.
          readOnly: true
          type: boolean
        minimumDueAmount:
          description: >
            The minimum or recurring amount due for this period (also called
            obligation). This amount is a sum of interest accrued,

            fees and part of a principal. This amount does not net any payments
            or service credits made in the period.


            If `loanType.statements.includeOverdueAmountInMinPayment` = `true`,
            the minimum payment calculation will include

            the minimum amount calculated for the closed period and overdue
            amount from previous periods.
          format: float
          type: number
        newBalanceAmount:
          description: The new balance amount for the period.
          format: float
          type: number
        paymentDueDate:
          description: The due date of the statement. This date is in the product timezone.
          format: date
          type: string
        periodId:
          description: The period identifier.
          type: string
        reason:
          description: >-
            If this statement was regenerated due to replay, the replay reason
            supplied by the user.
          nullable: true
          type: string
        replayId:
          description: >-
            If this statement was regenerated due to replay, the ID of the
            replay.
          nullable: true
          type: string
        statementDate:
          description: The statement date. This date is in the product timezone.
          format: date
          type: string
        statementLogicVersion:
          default: 3
          description: >
            The statement logic version. When a new statement is generated, it
            will use the current loan type `statementLogicVersion` value.

            That version is also stored on each statement object. When/if the
            statement is regenerated, it will use the

            `statementLogicVersion` value from the statement object vs. loan
            type. This guarantees that the system uses the same

            logic as the original statement.


            - Version `1` - first/original statement logic. All loan types
            created before the release of the version `3`, would be set to `1`.
            When a lender is ready, they can ask Peach to upgrade to version
            `3`. All statements that were generated before the release of
            version `3` would be marked as version `1` or `2`.

            - Version `2` - second statement logic that was introduced in Q2
            2024. This is a deprecated version and should not be used.

            - Version `3` - third statement logic that was introduced in Q4
            2024.
          type: integer
        userId:
          description: >-
            If this statement was regenerated due to replay, the ID of the user
            that initiated the replay.
          nullable: true
          type: string
        version:
          description: >
            The version of the statement. When a statement is updated, we don't
            delete the old version.

            We create a new version of the statement. The most recent version of
            the statement is returned.
          type: integer
      type: object
    schemas-Statement:
      allOf:
        - properties:
            createdAt:
              description: The timestamp (UTC) of when the statement was created.
              format: date-time
              readOnly: true
              type: string
            deletedAt:
              description: |
                The timestamp (UTC) of when the statement was deleted.
              format: date-time
              nullable: true
              readOnly: true
              type: string
            id:
              description: The statement's unique identifier.
              readOnly: true
              type: string
            updatedAt:
              description: >
                The timestamp (UTC) of when the statement was updated. On
                update, the system will create a new version of the statement.
              format: date-time
              nullable: true
              readOnly: true
              type: string
          type: object
        - $ref: '#/components/schemas/StatementSharedFields'
    RequestStartDate:
      description: >
        The start date of the promise to pay plan. If `startDate` is not
        provided upon promise to pay plan creation,

        the system will use the created date (i.e. "today") as the `startDate`.
        If `startDate` is provided, it must be a date in the future.

        Notes:

        - If you are providing a `schedule` object, you should not pass the
        `startDate`. In case both are provided in the 
          request, a `400 Bad Request error` will be returned.
        - If Peach's system creates the schedule based on
        `frequency`,`specificDays` and `duration` passed, the system will 
          schedule Promise to Pay Periods starting after the `startDate`.
      format: date
      type: string
    PromiseToPayPlanPost:
      properties:
        amount:
          description: >
            Amount required to be fulfilled for each period of the promise to
            pay plan. Peach's system will use the amount

            provided to trigger any required promise `status` transitions.


            Note: 

            - If `amount` is passed to the endpoint, ensure that `frequency` and
            `duration` are also provided.

            - If you are providing an `amount` object, you should not pass the
            `schedule`. In case both are provided in the 
              request, a `400 Bad Request error` will be returned.
          format: float
          minimum: 0.01
          type: number
        caseId:
          description: The ID of the case associated with the promise to pay plan.
          nullable: true
          type: string
        duration:
          description: >
            The duration of the promise to pay plan as a number of `frequency`
            periods. For example:

            if `frequency=weekly` and `duration=6`, the promise will be created
            with 6 weeks duration and will have 6 

            periods all with the same amount.


            Note: 

            - If `duration` is passed to the endpoint, ensure that `frequency`
            and `amount` are also provided.

            - If you are providing a `duration` object, you should not pass the
            `schedule`. In case both are provided in the 
              request, a `400 Bad Request error` will be returned.
          minimum: 1
          type: integer
        externalId:
          $ref: '#/components/schemas/ExternalId'
        frequency:
          description: >
            The agreed payment frequency of the promise. Peach's system will use
            the desired frequency to create promise to pay period(s) so the
            lender can monitor progress against promised payment dates and
            amount paid. 

            `weekly`, `everyTwoWeeks`, `twiceMonthly`, and `monthly` options
            create multiple promise to pay periods, according to the `duration`.

            `singleTerm` creates a promise with a single period and desired
            duration of X calendar days or a specific date that should be passed
            in `specificDays`. 


            Note: 

            - If `frequency` is passed to the endpoint, ensure that `duration`
            and `amount` are also provided.

            - If you are providing a `frequency` object, you should not pass the
            `schedule`. In case both are provided in the 
              request, a `400 Bad Request error` will be returned.
          enum:
            - weekly
            - everyTwoWeeks
            - twiceMonthly
            - monthly
            - singleTerm
          type: string
        previewMode:
          default: false
          description: >
            In `previewMode=true`, the Promise to Pay Plan and corresponding
            Promise Period Objects will be

            returned for preview without committing the object to database
          type: boolean
        schedule:
          description: >
            To create a custom promise to pay schedule with varying amounts or
            irregular periods, pass a `schedule` when 

            creating the promise to pay plan. 

            Note:

            Either `schedule` object or schedule descriptor attributes
            (`startDate`, `frequency`, `specificDays` 

            , 'duration' and 'amount') can be passed to create a promise to pay
            plan. In case both are provided in the 

            request, a `400 Bad Request error` will be returned.
          items:
            properties:
              amount:
                description: |
                  The promised amount.
                format: float
                minimum: 0.01
                type: number
              dueDate:
                description: |
                  The due date of the promised amount.
                format: date
                type: string
            type: object
          type: array
        sendNotice:
          default: true
          description: >
            When set to `true`, Peach's system will send a notice to the
            borrower about the promise to pay plan.

            Note: If `sendNotice` is not passed, the system will default to
            `true`.
          type: boolean
        specificDays:
          description: >
            Specific days designate the day(s) that due dates will fall on. The
            allowed values for specific

            day(s) depends on the `paymentFrequency`.


            `weekly` - provide one number in the valid range 1-7.
            1=Monday...7=Sunday.


            For example: [1].


            `everyTwoWeeks` - provide two inputs. The first input (required) is
            an integer in the valid range 1-7. 1=Monday...7=Sunday.


            The second input is a date that indicates when to start the cycle.
            If the second input is not passed, the system will default

            to the first valid start date based on the first input (the day of
            week passed in). If this date is provided then it can override

            the minimum due date gap specified on the loan type.


            For example: [1, "2020-09-16"].


            `twiceMonthly` - provide two numbers in the valid range 1-31.
            1=first day of a month. Use 31 to

            indicate the last day of a month.


            For example: [1, 15] or [15, 31].


            `monthly` - provide one number in the valid range 1-31. 1=first day
            of a month. Use 31 to indicate

            the last day of a month.


            For example: [1].


            `singleTerm` - provide one number to indicate duration as a number
            of calendar days or provide a valid calendar date in the

            future. For example: [90] or ["2020-09-16"].


            For `weekly`, `everyTwoWeeks`, `twiceMonthly`, `monthly`:

            If specificDays is left null, then the system will calculate due
            dates according to the paymentFrequency relative

            to the origination or activation date (or use existing specific days
            in the case of change due date).


            For `singleTerm`:

            The specificDays is mandatory.
          items:
            anyOf:
              - type: string
              - type: integer
          nullable: true
          type: array
        startDate:
          $ref: '#/components/schemas/RequestStartDate'
      type: object
    PromiseToPayPlanCancel:
      properties:
        cancellationCaseId:
          description: The case to associate with this promise to pay plan cancellation.
          nullable: true
          type: string
        cancellationReason:
          description: >
            The reason for canceling the promise to pay plan.


            `canceledByUser` - Promise to pay plan was canceled by an agent or
            borrower.

            `loanChargedOff` - loan was charged off during the promise period.

            `loanAccelerated` - loan was accelerated during the promise period.

            `otherPromisePlanOffered` - another promise plan was offered.

            `other` - for any other reason requiring cancellation.
          enum:
            - canceledByUser
            - loanChargedOff
            - loanAccelerated
            - otherPromisePlanOffered
            - other
          type: string
        reasonDetails:
          description: >
            Additional details about the reason for canceling the promise to pay
            plan.
          nullable: true
          type: string
      required:
        - cancellationReason
      type: object
    PromoProgramPaging:
      allOf:
        - $ref: '#/components/schemas/Paging'
        - properties:
            data:
              items:
                $ref: '#/components/schemas/PromoProgramResult'
              type: array
          type: object
    PromoProgramPut:
      allOf:
        - $ref: '#/components/schemas/PromoProgramPutCommon'
        - properties:
            status:
              description: |
                The promotional program status on a specific loan.

                  `pending` - the promotion was created but was not
                  activated yet.

                  `active` - the promotion is active.

                  `canceled` - the promotion has been canceled for a
                  reason. The reason provided in the `promoCancelReason`
                  attribute.

                  `exercised` - the promotion was successfully
                  exercised.
              enum:
                - pending
                - active
                - canceled
                - exercised
              type: string
          type: object
      description: Update a promo program
    PurchasesPaging:
      allOf:
        - $ref: '#/components/schemas/Paging'
        - properties:
            data:
              items:
                $ref: '#/components/schemas/Purchase'
              type: array
          type: object
    RefundDetails:
      description: The details of refund.
      properties:
        categoryId:
          description: The category identifier of the refund.
          nullable: true
          type: string
        description:
          default: Refund
          description: >
            The description of the refund. Normally shown in Borrower Portal and
            on statements. At least one of the attributes, `description`

            or `merchantName` must be passed.
          nullable: true
          type: string
        merchantId:
          description: The merchant identifier that the refund was used for.
          nullable: true
          type: string
        merchantName:
          description: >-
            The merchant name that the refund was used for. At least one of the
            attributes, `description` or `merchantName` must be passed.
          nullable: true
          type: string
        metadata:
          description: Store any type of key/value pairs in the form of a JSON dictionary.
          nullable: true
          type: object
        pointOfSaleType:
          description: >
            - `online` - the refund was made online on a website or in a mobile
            application.

            - `physical` - the refund was made in a store with a physical card
            or instrument.

            - `recurring` - the refund was made as part of a subscription
            service.
          enum:
            - online
            - physical
            - recurring
          type: string
      type: object
    LoanRefundTimestamps:
      properties:
        canceledAt:
          format: date-time
          type: string
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
      readOnly: true
      type: object
    LoanRefund:
      properties:
        atFaultParty:
          description: >
            The party at fault for the refund. Mainly used for
            ledger/accounting.


            If `loanOwner`, the lender is billed for the entire refund, and paid
            interest and fees are refunded to the borrower.


            If `loanServicer`, the servicer is billed for the entire refund, and
            paid interest and fees are refunded to the borrower.


            If `merchant`, the merchant is billed for the entire refund, and
            paid interest and fees are refunded to the borrower.


            If `borrower`, the merchant is billed for the entire refund, and the
            borrower receives no refund for paid interest and fees.
          enum:
            - loanOwner
            - loanServicer
            - merchant
            - borrower
          type: string
        caseId:
          description: The case identifier.
          type: string
        isFullRefund:
          description: >
            `true` if the refund is a full refund, `false` if the amount is a
            partial refund.
          readOnly: true
          type: boolean
        originalAmount:
          description: The original amount of the refund. The amount must be positive.
          format: float
          readOnly: true
          type: number
        refundAmount:
          description: >
            The refund amount. The maximum eligible refund amount is the
            `amountFinancedAtOrigination` of the loan. The refund is applied
            against the principal of the loan.
          exclusiveMinimum: true
          format: float
          minimum: 0
          type: number
        refundDate:
          description: >
            This attribute can be set only during the migration process of loans
            from another system to Peach. Any value passed for `active` loans
            will be ignored.


            The refund effective date in the product timezone. If not provided,
            the refund will be recorded in the ledger with an effective
            timestamp of the `Create refund` call.
          format: date
          type: string
        refundDetails:
          $ref: '#/components/schemas/RefundDetails'
        sendNotice:
          default: true
          description: >-
            When set to `false`, the system will NOT send a
            `loanRefundProcessed` notice to the borrower.
          type: boolean
          writeOnly: true
        timestamps:
          $ref: '#/components/schemas/LoanRefundTimestamps'
      required:
        - refundAmount
        - atFaultParty
      type: object
    LoanRefundCollectionResponse:
      properties:
        eligibleRefundAmount:
          description: >-
            The remaining amount eligible for refund. This is equal to the
            `amountFinancedAtOrigination` minus prior refund amounts.
          format: float
          type: number
        refunds:
          items:
            $ref: '#/components/schemas/LoanRefund'
          type: array
      type: object
    ReadOnlyInternalRefundDetails:
      allOf:
        - $ref: '#/components/schemas/InternalRefundDetails'
        - properties:
            refundNonDuePrincipalAmount:
              readOnly: true
            refundTransactionAmount:
              readOnly: true
            refundTransactionId:
              readOnly: true
          type: object
    RefundDetailsV2:
      allOf:
        - $ref: '#/components/schemas/ReadOnlyInternalRefundDetails'
        - properties:
            description:
              default: Refund
              description: >-
                The description of the refund. Normally shown in Borrower Portal
                and/or on statements.
              nullable: true
              type: string
            merchantId:
              description: The merchant identifier that the refund was used for.
              nullable: true
              type: string
            merchantName:
              description: The merchant name that the refund was used for.
              nullable: true
              type: string
            metadata:
              description: >-
                Store any type of key/value pairs in the form of a JSON
                dictionary.
              nullable: true
              type: object
          type: object
    LoanRefundV2:
      properties:
        atFaultParty:
          description: >
            The party at fault for the refund. Mainly used for
            ledger/accounting.


            If `loanOwner`, the lender is billed (on accounting level) for the
            refund.


            If `loanServicer`, the servicer is billed (on accounting level) for
            the refund.


            If `merchant`, the merchant is billed (on accounting level) for the
            refund.


            If `borrower`, the merchant is billed (on accounting level) for the
            refund.
          enum:
            - loanOwner
            - loanServicer
            - merchant
            - borrower
          type: string
        canceledBy:
          $ref: '#/components/schemas/UserActionInfo'
          description: |
            Details of the user responsible for canceling the refund.
            Can be an agent or automated system process.
        cancellationCaseId:
          description: The cancellation case identifier.
          readOnly: true
          type: string
        cancellationReason:
          description: >
            The reason why the refund was canceled.


            `wrongAmountOrDetails` - the refund was created with the wrong
            amount or details.


            `processingError` - the refund could not be processed.


            `other` - any other reason why the refund was canceled.
          enum:
            - wrongAmountOrDetails
            - processingError
            - other
          readOnly: true
          type: string
        cancellationReasonDetails:
          description: >-
            The reason for refund cancellation. This is typically entered by an
            agent canceling a refund via the front end.
          readOnly: true
          type: string
        caseId:
          description: The case identifier.
          type: string
        createdBy:
          $ref: '#/components/schemas/UserActionInfo'
          description: |
            Details of the user responsible for creating the refund.
            Can be an agent or automated system process.
        externalId:
          description: >
            A lender's identifier for the refund.


            After the object is successfully created, a lender can use ID or
            externalId identifiers to fetch the object.


            To fetch the object using `externalId` you need to add `ext-` to the
            URL.


            Note: Don't add ext- to the identifier value. For example: if the
            external identifier is `ABCDE`, then pass `externalId=ACBCE`

            and NOT `ext-ABCDE` when creating the object.
          minLength: 1
          nullable: true
          type: string
        feesExceptionList:
          default: []
          description: >
            A list of the dynamic fees (aka LoanFee) identifiers that will not
            be refunded/canceled. The identifiers can be Peach or

            lender's external identifiers.

            This allows lenders to exclude specific fees from being refunded.

            For example:
             - `isRefundLateFees=true`
             - `feesExceptionList=[LF-K98P-NM3E]`
            The system will refund/cancel all late fees except for
            `LF-K98P-NM3E`.
          items:
            type: string
          type: array
        id:
          readOnly: true
          type: string
        isFullRefund:
          description: >
            `true` if the refund is a full refund, `false` if the amount is a
            partial refund.
          readOnly: true
          type: boolean
        isRefundDownPayment:
          default: false
          description: >
            If `true`, the system will refund the down payment amount (assuming
            the down payment was paid by the borrower).

            Only applicable if refunded for a full amount.
          type: boolean
        isRefundLateFees:
          default: false
          description: >
            If `true`, the system will cancel any late fees charged after
            `refundDate + refundTimeOfDay`.

            If `false`, the system will not cancel any late fees as part of the
            refund.
          type: boolean
        isRefundMDR:
          default: false
          description: >
            If `true`, the system will record the prorated MDR amount to the
            merchant within the ledger.

            Peach is not involved in the settlement process with merchants, and
            will only record amounts in the ledger.

            Only applicable if `refundDate` equals the activation date.
          type: boolean
        isRefundOriginationFees:
          default: false
          description: >
            If `true`, the system will forego origination fee. Only applicable
            if the `refundDate` is the loan activation date.

            If `false`, the system will not do anything with the origination fee
            as part of the refund.


            Note: refunding the origination fee is different from calling
            "Update origination fee" endpoint.

            When the origination fee is refunded, the system books the
            origination fees amount and move the entries to "foregone"

            immediately after.

            When the origination fee amount is updated via `Update origination
            fee`, the system changes the origination fee amount,

            re-books the fee from the activation date and replays the loan.
          type: boolean
        isRefundOtherFees:
          default: false
          description: >
            If `true`, the system will cancel any dynamic fees (except for late
            fees and fees listed in the `otherFeesExceptionList`)

            charged after `refundDate + refundTimeOfDay`.


            If `false`, the system will not cancel any dynamic fees (other than
            late fees and fees listed in the

            `otherFeesExceptionList`) as part of the refund.


            Note: if an account ends in `paidOff` status after the refund is
            applied, any service fees after the payoff date will

            be canceled, regardless of the `isRefundOtherFees` value.
          type: boolean
        originalAmount:
          description: The original amount of the refund. The amount must be positive.
          format: float
          readOnly: true
          type: number
        refundAmount:
          description: >
            The refund amount. The maximum eligible refund amount is the
            `amountFinancedAtOrigination` of the loan. The refund is applied
            against the principal of the loan.
          exclusiveMinimum: true
          format: float
          minimum: 0
          type: number
        refundDate:
          description: >
            The refund effective date in the product timezone. The `refundDate`
            can be any date between the activation date and the current date.

            If not provided, the refund will be recorded in the ledger with an
            effective timestamp of the `Create refund` call.


            To make the refund effective from the beginning of the loan, please
            pass the activation date and don't pass `refundTimeOfDay`.

            In this case, the system will create the refund immediately after
            the activation.
          format: date
          type: string
        refundDetails:
          $ref: '#/components/schemas/RefundDetailsV2'
        refundTimeOfDay:
          allOf:
            - $ref: '#/components/schemas/TimeOfDay'
            - default:
                hour: 12
                minute: 1
                second: 0
          description: >
            The effective time of day on `refundDate` in the product timezone.
            The default value is 12:01:00 AM in the product timezone.


            Note: for migration only, the value must be after 2AM in the product
            timezone.
          writeOnly: true
        sendNotice:
          default: true
          description: >-
            When set to `false`, the system will NOT send a
            `loanRefundProcessed` notice to the borrower.
          type: boolean
          writeOnly: true
        status:
          description: >-
            The status of the refund. - `settled` - the refund was successfully
            processed. - `processing` - the refund is being processed. Wait
            until the status changes to `succeeded` or `canceled`. - `canceled`
            - the refund was canceled or not processed.
          enum:
            - settled
            - processing
            - canceled
          nullable: true
          readOnly: true
          type: string
        timestamps:
          $ref: '#/components/schemas/LoanRefundTimestamps'
      required:
        - refundAmount
        - atFaultParty
      type: object
    LoanRefundCancel:
      allOf:
        - properties:
            cancellationReason:
              description: |
                Reason the refund was canceled.
              enum:
                - wrongAmountOrDetails
                - processingError
                - other
              type: string
            cancellationReasonDetails:
              description: >
                The reason for refund cancellation. This is typically entered by
                an agent canceling a refund via the front end.
              type: string
          type: object
        - $ref: '#/components/schemas/CaseId'
    properties-caseId:
      description: An identifier for an existing case.
      type: string
    LoanReimburse:
      properties:
        caseId:
          $ref: '#/components/schemas/properties-caseId'
        contactId:
          description: >
            An identifier of an existing contact. Required if the
            `paymentInstrumentType` is `check` and the check is processed/sent
            by Peach.
          type: string
        customDisplayName:
          description: >
            A friendly description of the transaction. If provided, this value
            will be displayed in Peach UI/App and Statements (or can be used by
            lender in their App). If the value is not provided, the Peach UI/App
            and Statements logic will render the transaction name based on type
            and status. Make sure you provide value that makes sense to the
            borrower.

            This is NOT what the borrower will see in their online bank or card
            account.
          nullable: true
          type: string
        externalTransactionId:
          description: >-
            A transaction external identifier. If passed, the new reimbursement
            transaction that the system will create will have the
            `externalTransactionId`.
          type: string
        isExternal:
          description: >-
            If set to `true`, the lender assumes responsibility for transferring
            funds to the borrower. If set to `false`, Peach handles the transfer
            of funds to the borrower.
          type: boolean
        paymentInstrumentId:
          description: >-
            Peach's unique or lender's external identifier. Not required if the
            paymentInstrumentType=check and the check is processed/sent by
            Peach.
          pattern: ^ext-|^[A-Z]{2}-[A-Z0-9]+-[A-Z0-9]+|^\d+$
          type: string
        paymentInstrumentType:
          enum:
            - bankAccount
            - card
            - check
            - payroll
            - paymentNetwork
          type: string
        reimbursementAmount:
          description: The requested reimbursement amount.
          format: float
          type: number
        transactionStatus:
          description: >
            Only applicable if isExternal=true. The status in which the new
            reimbursement transaction will be created. If the status is set to
            pending, the caller

            can later update the transaction status via Update transaction
            endpoint. Only applicable if isExternal=true.
          enum:
            - pending
            - succeeded
          type: string
      required:
        - paymentInstrumentType
        - reimbursementAmount
      type: object
    LoanReverseAccelerateResponse:
      properties:
        reversedAcceleratedAmount:
          description: The amount of the acceleration reversal.
          format: float
          type: number
      type: object
    LoanReverseChargeOffResponse:
      properties:
        reversedChargeOffAmount:
          description: The amount of the charge-off reversal.
          format: float
          type: number
      type: object
    EveryTwoWeeksOptions:
      properties:
        days:
          items:
            properties:
              date:
                format: date
                type: string
              day:
                enum:
                  - Monday
                  - Tuesday
                  - Wednesday
                  - Thursday
                  - Friday
                  - Saturday
                  - Sunday
                type: string
              dayOfWeek:
                type: integer
            type: object
          type: array
      type: object
    LoanScheduleOptions:
      properties:
        frequencyOptions:
          properties:
            everyTwoWeeks:
              $ref: '#/components/schemas/EveryTwoWeeksOptions'
          type: object
      type: object
    StatementsPaging:
      allOf:
        - $ref: '#/components/schemas/Paging'
        - properties:
            data:
              items:
                $ref: '#/components/schemas/schemas-Statement'
              type: array
          type: object
      title: statements
    StatementActivity:
      properties:
        activityType:
          description: |
            The activity type.
          enum:
            - fee
            - payment
            - paymentReversal
            - credit
            - creditReversal
            - refund
            - reimbursement
            - purchase
          type: string
        amount:
          description: |
            The amount of the activity.
          format: float
          type: number
        dateOfActivity:
          description: |
            The date the activity was posted.
          format: date
          type: string
        description:
          description: |
            The description of the activity.
          type: string
        effectiveDate:
          description: |
            The effective date of the activity in the product timezone.
          format: date
          type: string
        referenceNumber:
          description: |
            The reference number or identifier of the activity.
          type: string
      type: object
    StatementActivityV2:
      properties:
        activityType:
          description: |
            The activity type.
          enum:
            - fee
            - payment
            - paymentReversal
            - credit
            - creditReversal
            - refund
            - reimbursement
            - purchase
            - advance
            - purchaseDispute
            - cashback
          type: string
        amount:
          description: >
            The effective amount of the activity that was applied in the ledger
            in the current or a past

            period. `amount` and `originalAmount` are expected to be equal
            unless something happened to

            the activity after the activity was originally applied in the
            ledger.


            Example 1:
              - A payment was originally processed for $100.00 from the borrower's bank account.
              - Later, $30.00 was reversed (the $30.00 was sent back to the borrower's bank account).
              - The `amount` would be equal to $70.00.
              - The `originalAmount` would be equal to $100.00

            Example 2:
              - A service fee of $10.00 was supposed to be charged.
              - A line (e.g. credit card) had a credit balance of $3.50 (in other words, $3.50 was owed to a borrower).
              - The `amount` would be equal to $6.50.
              - The `originalAmount` would be equal to $10.00.

            It's important to understand how `amount` is used to calculate
            either:
              - One of the "total" attributes such as `totalPaymentsForThisPeriod`.
              - Or, the `totalAdjustmentsForThisPeriod`.

            When `isAdjustment=false`, the `amount` is used to calculate one of
            the "total" attributes: `totalPaymentsForThisPeriod`,
            `totalFeesForThisPeriod`, etc.


            When `isAdjustment=true`, the `amount` is reflected in the
            `totalAdjustmentsForThisPeriod`. This is because

            the reported activity impacted one of the past periods, the loan was
            replayed and the balance was adjusted.

            Keep in mind that `totalAdjustmentsForThisPeriod` is equal to sum of
            activities' `amount` and the

            `interestAdjustmentForThisPeriod`. For example:
              - A payment was originally processed for $100.00 two periods ago.
              - Later, the payment was disputed by a borrower and the chargeback was accepted for the full amount of $100.00.
              - If the line accrues interest, the `totalAdjustmentsForThisPeriod` would be different from $100.00 because additional interest was accrued.
              - The `amount` would be equal to $0.00.
              - The `originalAmount` would be equal to $100.00.
              - The `interestAdjustmentForThisPeriod` would be equal to $1.42.
              - The `totalAdjustmentsForThisPeriod` would be equal to $101.42.
          format: float
          type: number
        dateOfActivity:
          description: >
            The date when the activity was created. Also called "transaction
            date". Most activities will have `dateOfActivity` equals to
            `effectiveDate`.


            In some cases, `dateOfActivity` can be different from
            `effectiveDate`. For example:
              - A credit card purchase was made and authorized on Mar 11, 2023.
              - The purchase was captured/settled on Mar 13, 2023.
              - dateOfActivity is Mar 11, 2023.
              - effectiveDate is Mar 13, 2023.
          format: date
          type: string
        description:
          description: |
            The description of the activity.
          type: string
        displaySign:
          description: |
            The sign that should be displayed next to the amount.
          enum:
            - positive
            - negative
          type: string
        drawId:
          description: >
            The draw identifier that the activity belongs to. Only applicable to
            line of credit and the following activity types: `fee`, `purchase`,
            `purchaseDispute`.
          nullable: true
          type: string
        effectiveDate:
          description: >
            The date when the activity was applied in the ledger in the product
            timezone. Also called "post date". Most activities will have
            `dateOfActivity` equals to `effectiveDate`.


            In some cases, `dateOfActivity` can be different from
            `effectiveDate`. For example:
              - A credit card swipe/purchase was made and authorized on Mar 11, 2023.
              - The purchase was captured/settled on Mar 13, 2023.
              - `dateOfActivity` is Mar 11, 2023.
              - `effectiveDate` is Mar 13, 2023.
          format: date
          type: string
        isAdjustment:
          description: >
            `false` if the activity was originally applied in the ledger in the
            current period. In other words, it's not an adjustment of an
            activity that was already reported in a past period.


            `true` if the activity was reported in the current period but it
            impacted one of the past periods. In other words, the activity is a
            change or an adjustment of one of the prior activities that was
            reported in a past period.

            When an activity with an effective date in one of the past periods
            is reported, the balance impact is captured in the
            `totalAdjustmentsForThisPeriod` attribute. Keep in mind that
            `totalAdjustmentsForThisPeriod` can be different from the activity
            `amount`.


            Example:
              - A payment was originally processed for $100.00 two periods ago. That activity was reported as `isAdjustment=false`.
              - Later, the payment was disputed by a borrower and the chargeback was accepted for the full amount of $100.00. The chargeback activity would be reported as `isAdjustment=true`.
              - If the line accrues interest, the `totalAdjustmentsForThisPeriod` would be different from $100.00 because additional interest was accrued.
              - The `amount` would be equal to $0.00.
              - The `originalAmount` would be equal to $100.00.
              - The `amountForTotals` would be equal to $0.00.
              - The `totalAdjustmentsForThisPeriod` would be greater than $100.00.
          type: boolean
        originalAmount:
          description: >
            The original amount of the activity that was applied in the ledger
            before any changes or adjustments.
          format: float
          type: number
        referenceNumber:
          description: |
            Peach Public ID of the underlying object that created the activity.
          type: string
        referenceNumberExternal:
          description: >
            External ID of the underlying object that created the activity. If
            the corresponding object doesn't have an `externalId`, the attribute
            value will be `null`.
          nullable: true
          type: string
      type: object
    BaseStatementDetails:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - $ref: '#/components/schemas/StatementSharedFields'
        - properties:
            autopay:
              description: >
                The Autopay details at the time of statement generation. Note:
                Autopay plan can be canceled any time by the borrower, agent (on
                behalf of the borrower) or system (e.g. bank account closed).
              properties:
                paymentInstrumentId:
                  description: >-
                    The payment instrument ID with which this autopay plan will
                    be charged through.
                  nullable: true
                  type: string
                schedule:
                  items:
                    properties:
                      amount:
                        description: The amount of the expected payment.
                        format: float
                        type: number
                      date:
                        description: The due date of the expected payment.
                        format: date
                        type: string
                    type: object
                  type: array
              type: object
            borrowerDetails:
              description: |
                The borrower details.
              properties:
                address:
                  $ref: '#/components/schemas/Address'
                name:
                  description: >
                    The borrower name. If the borrower is a person, the value
                    will be `firstName` + `lastName`.

                    If the borrower is a business, the value will be
                    `businessName`.
                  type: string
              type: object
            creditBalanceAmount:
              description: |
                The total amount of money that the lender owes to the borrower.
              format: float
              type: number
            creditBalanceNetChangeAmount:
              description: |
                The net change amount of the `creditBalanceAmount` (also
                called `reimbursementAmount`) during the period.

                Example 1:

                  - In the prior period `newBalanceAmount`=0 and
                    `creditBalanceAmount`=100.
                  - In the this period:
                    - A new purchase or advance was made in amount of $35
                      (`creditBalanceAmount` decreased by 35).
                  - The `creditBalanceNetChangeAmount`=-35.

                Example 2:

                  - In the prior period `newBalanceAmount`=0 and
                    `creditBalanceAmount`=100.
                  - In the this period:
                    - A check in amount of $20 was posted
                      (`creditBalanceAmount` increased by 20).
                    - A new purchase or advance was made in amount of $35
                      (`creditBalanceAmount` decreased by 35).
                  - The `creditBalanceNetChangeAmount`=+20-35=-15.
              format: float
              type: number
            daysInBillingCycle:
              description: >
                The number of calendar days in the billing cycle (also called
                period).
              type: integer
            fulfilledAmount:
              description: >-
                The total amount of payments and service credits applied towards
                minimumAmountDue.
              format: float
              type: number
            interestAdjustmentForThisPeriod:
              description: >
                In some cases account balances can be adjusted because some
                event changed in the past. For example: late

                return of a payment which results in additional interest charged
                for a period in the past. When such

                adjustments are made this attribute reflects the net adjusted
                interest amount. The interest adjustment can

                be positive or negative.
              format: float
              nullable: true
              type: number
            isDisplayLatePaymentWarning:
              description: >
                If `true`, the statement should show a special warning amount
                late fees - "Late Payment Warning" paragraph.

                If the product type doesn't have any late fees the system will
                return `false`.
              type: boolean
            lastPeriodFeesPaid:
              description: >
                Fees amount paid (by the borrower or via credit) in the
                statement corresponding period.
              format: float
              type: number
            lastPeriodInterestPaid:
              description: >
                Interest amount paid (by the borrower or via credit) in the
                statement corresponding period.
              format: float
              type: number
            lastPeriodOverPaid:
              description: >
                Excess amount paid (by the borrower or via credit) that was not
                allocated to principal,

                interest or fees in the statement corresponding period.
              format: float
              type: number
            lastPeriodPrincipalPaid:
              description: >
                Principal amount paid (by the borrower or via credit) in the
                statement corresponding period.
              format: float
              type: number
            lastPeriodTotalPaid:
              description: >
                Total amount paid (by the borrower or via credit) in the
                statement corresponding period.
              format: float
              type: number
            lateFeeUpToAmount:
              description: >
                The maximum amount of late fee that can be charged in the period
                (if the borrower doesn't pay on time). The attribute will have
                value if `isDisplayLatePaymentWarning` is `true`.
              format: float
              type: number
            loanStatus:
              allOf:
                - $ref: '#/components/schemas/LoanStatus'
                - readOnly: true
            newPrincipalBalance:
              description: >
                Principal balance of the account as of the statement date and
                corresponding period.
              format: float
              type: number
            overdueAmount:
              description: >
                Overdue amount as of the statement date and corresponding
                period.
              format: float
              type: number
            overpaymentsAmount:
              description: >
                In the case that loan policy allows, this represents the amount
                of overpayments applied to the period. Overpayments will only
                arise when

                an obligation (aka `minimumAmountDue`) is completely fulfilled.
              format: float
              type: number
            previousBalance:
              description: |
                Previous statement balance (also called `newBalance`).
              format: float
              type: number
            previousCreditBalanceAmount:
              description: >
                The total amount of money that the lender owed to the borrower
                in the previous statement.
              format: float
              type: number
            promoPrograms:
              items:
                properties:
                  description:
                    description: |
                      A legal description of the promotional program as it
                      should be communicated and shown to borrowers.
                      If the description is provided, borrowers will see
                      the description in the Borrower Portal.
                    type: string
                  displayName:
                    description: |
                      The promotional program name as it is shown to
                      borrowers.
                    type: string
                  drawId:
                    type: string
                  externalId:
                    type: string
                  id:
                    type: string
                  promoCancelReason:
                    $ref: '#/components/schemas/PromoCancelReason'
                  promoEndDate:
                    $ref: '#/components/schemas/PromoStartDate'
                  promoExercisedDate:
                    format: date
                    type: string
                  promoStartDate:
                    $ref: '#/components/schemas/PromoStartDate'
                  promoType:
                    $ref: '#/components/schemas/PromoType'
                  remainingAmountToExercise:
                    description: |
                      Represents the remaining balance needed to be paid in
                      order to exercise the promotional program.
                    type: number
                  status:
                    description: |
                      The promotional program status on a specific loan.

                        `pending` - the promotion was created but was not
                        activated yet.

                        `active` - the promotion is active.

                        `canceled` - the promotion has been canceled for a
                        reason.
                        The reason provided in the `promoCancelReason`
                        attribute.

                        `exercised` - the promotion was successfully
                        exercised.
                    enum:
                      - pending
                      - active
                      - canceled
                      - exercised
                    type: string
                  totalDeferredInterestAmount:
                    description: |
                      The total deferred interest accrued.
                      If the deferred interest promotion is exercised, the
                      deferred interest is not expected to be paid.
                      Only for deferred interest promo programs.
                    type: number
                required:
                  - id
                  - status
                  - promoType
                type: object
              type: array
            remainingAmount:
              description: >-
                The total amount remaining to be paid by the borrower after
                accounting for payments and service credits applied in the
                period.
              format: float
              type: number
            statementActivities:
              items:
                oneOf:
                  - $ref: '#/components/schemas/StatementActivity'
                  - $ref: '#/components/schemas/StatementActivityV2'
              type: array
            statementLogicVersion:
              default: 3
              description: >
                The statement logic version. When a new statement is generated,
                it will use the current loan type `statementLogicVersion` value.

                That version is also stored on each statement object. When/if
                the statement is regenerated, it will use the

                `statementLogicVersion` value from the statement object vs. loan
                type. This guarantees that the system uses the same

                logic as the original statement.


                - Version `1` - first/original statement logic. All loan types
                created before the release of the version `3`, would be set to
                `1`. When a lender is ready, they can ask Peach to upgrade to
                version `3`. All statements that were generated before the
                release of version `3` would be marked as version `1` or `2`.

                - Version `2` - second statement logic that was introduced in Q2
                2024. This is a deprecated version and should not be used.

                - Version `3` - third statement logic that was introduced in Q4
                2024.
              type: integer
            totalAdjustmentsForThisPeriod:
              description: >
                In some cases account balances can be adjusted because some
                event changed in the past.

                For example: late return of a payment or interest changed for a
                period in the past.

                When such adjustments are made this attribute reflects the net
                adjusted amount.
              format: float
              type: number
            totalCreditReversalsForThisPeriod:
              description: |
                Total of credits reversed/canceled in the period.
              format: float
              type: number
            totalCreditsForThisPeriod:
              description: |
                Total of credits applied in the period.
              format: float
              type: number
            totalFeesForThisPeriod:
              description: |
                Total amount of fees charged in the period.
              format: float
              type: number
            totalInterestForThisPeriod:
              description: |
                For LOC:
                  Total amount of interest accrued on draws in the period. The interest amount accrued on each draw is truncated to the nearest cent and
                  the sum of the truncated values is reported by this field.
                For installment loan:
                  If the period is still open, the amount will be accrued interest in the period plus expected interest to be accrued until the due date.
              format: float
              type: number
            totalPaymentReversalsForThisPeriod:
              description: >
                Total of payments reversed/returned to the borrower in the
                period.
              format: float
              type: number
            totalPaymentsForThisPeriod:
              description: |
                Total of payments made in the period.
              format: float
              type: number
            totalRefundsForThisPeriod:
              description: |
                Total of refunds applied in the period.
              format: float
              type: number
            year:
              description: >
                The year of the statement. Year-to-date fields are calculated
                based on this value.

                Usually the `endDate` of the statement period is the reference
                for the year. The exception is when the `statementDate`

                is before the `endDate`, in which case `statementDate` is the
                reference for the year.
              type: string
            yearToDateFeesCharged:
              description: >
                Total amount of fees charged in the current year from 01/01/YYYY
                to the statement date.
              format: float
              type: number
            yearToDateInterestCharged:
              description: >
                Total amount of interest charged in the current year from
                01/01/YYYY to the statement date. This field is computed as the
                sum

                of the interest accrued by the draws on this line and then
                rounded to the nearest cent.
              format: float
              type: number
            ytdFeesPaid:
              description: >
                Fees amount paid (by the borrower or via credit) year to date,
                from 01/01/YYYY to the statement date.
              format: float
              type: number
            ytdInterestPaid:
              description: >
                Interest amount paid (by the borrower or via credit) year to
                date, from 01/01/YYYY to the statement date.
              format: float
              type: number
            ytdOverPaid:
              description: >
                Excess amount paid (by the borrower or via credit) that was not
                allocated to principal,

                interest or fees year to date, from 01/01/YYYY to the statement
                date.
              format: float
              type: number
            ytdPrincipalPaid:
              description: >
                Principal amount paid (by the borrower or via credit) year to
                date, from 01/01/YYYY to the statement date.
              format: float
              type: number
            ytdTotalPaid:
              description: >
                Total amount paid (by the borrower or via credit) year to date,
                from 01/01/YYYY to the statement date.
              format: float
              type: number
          type: object
    InstallmentStatementDetails:
      allOf:
        - $ref: '#/components/schemas/BaseStatementDetails'
        - properties:
            apr:
              description: The effective APR.
              format: float
              type: number
            prepaidAmount:
              description: |
                Amount paid in the period prior to due date.
              format: float
              type: number
            recurringAmount:
              description: |
                The most recent amortized recurring amount.
              format: float
              type: number
            totalAdvancesForThisPeriod:
              description: |
                The total amount of advances made in the period.
              format: float
              nullable: true
              type: number
            totalAmountDue:
              description: >
                The total amount due for the period as of the time when the
                statement was generated. It represents the sum

                of the minimumAmountDue and overdueAmount minus any payments or
                service credits applied in the period.
              format: float
              type: number
          title: Installment
          type: object
      title: Installment
    StatementDrawInfo:
      properties:
        apr:
          description: >
            The net interest rate (also called APR), interest rate minus promo
            rate, of the draw/sub-line as of the last day of the period (aka
            `billingCycleEndDate`).
          format: float
          type: number
        availableCredit:
          description: Available credit for this specific draw.
          format: float
          type: number
        balanceEndOfPeriod:
          description: |
            The draw/sub-line remaining balance at the end of the period.
          format: float
          type: number
        creditLimit:
          description: The credit limit amount for the draw.
          format: float
          type: number
        deferredInterestForThisPeriod:
          description: >
            The deferred interest accrued for this period only.

            If the deferred interest promotion is exercised, the deferred
            interest

            is not expected to be paid.
          format: float
          type: number
        drawId:
          description: The draw identifier.
          type: string
        fulfilledAmount:
          description: >-
            The total amount of payments and service credits applied towards
            `minAmountDue``.
          format: float
          type: number
        interestCharged:
          description: >
            The amount of interest accrued in the period. This value is computed
            by truncating (to the nearest cent) the interest accrued in this
            period.

            This is amount is equal to the sum of
            `interestChargedDetails.interestCharged` amounts in the
            `interestChargedDetails` array.
          format: float
          type: number
        interestChargedDetails:
          description: Details of interest charged in the period.
          items:
            properties:
              balanceSubjectToInterestRate:
                description: >
                  The average balance of draw/sub-line that was subject to the
                  `interestRate`. Calculated by adding the principal amount on
                  days with `interestRate`

                  divided by `numberDays`. Also called Average Daily Balance.
                format: float
                type: number
              interestChargeType:
                description: >
                  The type of interest charge.

                  - `daily` - a standard daily accrual in the period.

                  - `deferred` - deferred interest that was recognized/charged
                  in the period. Note: the interest amount that was charged in
                  the period 
                                 is a total of deferred interest that was accrued across multiple periods.
                enum:
                  - daily
                  - deferred
                type: string
              interestCharged:
                description: >
                  The net interest rate (also called APR). Calculated as
                  interest rate minus promo rate of the draw/sub-line as of the
                  last day of the period (aka the billingCycleEndDate).
                format: float
                type: number
              interestRate:
                description: >
                  The net interest rate that the balance accrued interest for
                  `numberDays`. If the draw has a single interest rate, the
                  value is also called

                  APR of the draw/sub-line. If the draw was created in the
                  middle of the period or was paid off before the period ended,
                  the system will count

                  days as `interestRate=0`.
                format: float
                type: number
              numberDays:
                description: >
                  Number of days in the period that principal was subject to the
                  `interestRate`. Sum of `numberDays` in the array is equal to
                  the number of days in the period.
                type: integer
            type: object
          type: array
        isVariableRate:
          description: |
            `true` if the rate is variable. `false` if the rate is fixed.
          type: boolean
        minAmountDue:
          description: |
            The minimum amount due of the draw/sub-line for the period.
          format: float
          type: number
        nameOfBalance:
          description: |
            The name of the balance (also called draw/sub-line).
          type: string
        overLimitAmount:
          description: >
            The amount by which the balance exceeded the credit limit for the
            draw. This amount is expected to be greater than 0 

            only when the credit limit is exceeded.
          format: float
          type: number
        overpaymentsAmount:
          description: >
            In the case that loan policy allows, this represents the amount of
            overpayments applied to the period. Overpayments will only arise
            when an

            obligation (aka `minAmountDue`) is completely fulfilled.
          format: float
          type: number
        remainingAmount:
          description: >-
            The total amount remaining to be paid by the borrower after
            accounting for payments and service credits applied in the period.
          format: float
          type: number
        totalDeferredInterestAmount:
          description: >
            The total deferred interest accrued.

            If the deferred interest promotion is exercised, the deferred
            interest

            is not expected to be paid. Only for deferred interest promo
            programs.
          format: float
          type: number
        totalPurchasesForThisPeriod:
          description: >
            Total of new purchases on the draw in the period corresponding to
            the statement.
          format: float
          type: number
        utilizationAmount:
          $ref: '#/components/schemas/UtilizationAmount'
      type: object
    LOCStatementDetails:
      allOf:
        - $ref: '#/components/schemas/BaseStatementDetails'
        - properties:
            authorizedPurchasesAmount:
              description: >
                The total amount of authorized purchases at the time of
                statement generation. This amount reduces `availableCredit`

                and `openToBuy`; is not included in the `newBalanceAmount`; and
                appears in the Account Summary section of the statement.
              format: float
              nullable: true
              type: number
            availableCredit:
              description: |
                Available credit to use.
              format: float
              type: number
            creditLimit:
              description: >
                The credit limit amount for the line or draw. Only applicable to
                line of credit or installment loan with multiple

                advances. For installment loans with multi-advances, it is the
                amount financed set at origination.
              format: float
              type: number
            gracePeriod:
              deprecated: true
              description: ' If `true`, the account is eligible for the benefits of "grace period".'
              type: boolean
            isDisplayMinimumPaymentWarning:
              description: >
                If `true`, the statement should show a special warning amount
                minimum payment - "Minimum Payment Warning" paragraph and table.
              type: boolean
            locClosedDate:
              description: >
                The date LOC was closed in the product timezone. If LOC is
                closed, new purchases are not allowed. Closed LOC can still have
                outstanding balance.
              format: date
              type: string
            minimumPaymentWarning:
              description: >-
                The details required to show the Minimum Payment Warning table
                in the statement.
              properties:
                comparedToDuration:
                  description: >
                    The number of years it should take to pay off the balance if
                    the borrower pays the `comparedToPaymentAmount` only.

                    *Per regulations*:

                    If the minimum payment repayment estimate is less than 2
                    years, the card issuer must disclose the estimate in months.

                    Otherwise, the estimate must be disclosed in years and
                    rounded to the nearest whole year.
                  type: integer
                comparedToDurationMonths:
                  description: >
                    The number of months it should take to pay off the balance
                    if the borrower pays the `comparedToPaymentAmount` only.

                    *Per regulations*:

                    If the minimum payment repayment estimate is less than 2
                    years, the card issuer must disclose the estimate in months.

                    Otherwise, the estimate must be disclosed in years and
                    rounded to the nearest whole year.
                  type: integer
                comparedToPaymentAmount:
                  description: |
                    The payment amount that the minimum amount is compared to.
                  format: float
                  type: number
                comparedToTotalCostAmount:
                  description: >
                    The estimated total amount (or cost) the borrower is
                    expected to pay if the borrower pays the
                    `comparedToPaymentAmount` only.
                  format: float
                  type: number
                minimumPaymentDuration:
                  description: >
                    The number of years it should take to pay off the balance if
                    the borrower makes the minimum payment only.

                    *Per regulations*:

                    If the minimum payment repayment estimate is less than 2
                    years, the card issuer must disclose the estimate in months.

                    Otherwise, the estimate must be disclosed in years and
                    rounded to the nearest whole year.
                  type: integer
                minimumPaymentDurationMonths:
                  description: >
                    The number of months it should take to pay off the balance
                    if the borrower makes the minimum payment only.

                    *Per regulations*:

                    If the minimum payment repayment estimate is less than 2
                    years, the card issuer must disclose the estimate in months.

                    Otherwise, the estimate must be disclosed in years and
                    rounded to the nearest whole year.
                  type: integer
                minimumPaymentTotalCostAmount:
                  description: >
                    The estimated total amount (or cost) the borrower is
                    expected to pay if the borrower makes the minimum payment
                    only.
                  format: float
                  type: number
              type: object
            statementDrawInfo:
              items:
                $ref: '#/components/schemas/StatementDrawInfo'
              type: array
            totalCashBacksForThisPeriod:
              description: |
                Total of cashBacks applied in the period.
              format: float
              type: number
            totalPurchasesForThisPeriod:
              description: >
                Total of new purchases in the period corresponding to the
                statement.
              format: float
              type: number
            utilizationAmount:
              $ref: '#/components/schemas/UtilizationAmount'
          title: Line of Credit
          type: object
      title: Line of Credit
    StatementDetails:
      oneOf:
        - $ref: '#/components/schemas/InstallmentStatementDetails'
        - $ref: '#/components/schemas/LOCStatementDetails'
    TransactionsPaging:
      allOf:
        - $ref: '#/components/schemas/NewPaginator'
        - properties:
            data:
              items:
                $ref: '#/components/schemas/Transaction'
              type: array
          type: object
      title: transactions
    TransactionCreationStatus:
      description: >
        The transaction status. May only be passed when `isExternal=true`.


        External transactions can be created in: `scheduled`, `initiated`,
        `pending`, `succeeded`, or `failed`.

        External transactions are applied to the loan balance immediately when
        created with status `initiated`, `pending`, or `succeeded`. Otherwise,

        they will be applied the first time they are updated to one of these
        statuses.


        `scheduled` - payment or credit was scheduled for a future date that has
        not arrived yet. The payment has not applied to a loan yet.


        `initiated` - payment was initiated and sent to a payment processor. The
        payment is applied to a loan. This status is used normally for ACH.


        `pending` - payment was acknowledged by the payment processor and is
        being processed. For ACH the payment can be in pending status for a few
        days.


        `succeeded` - payment was completed successfully.


        `failed` - payment failed and was removed from the loan effective as of
        `initiated`, `pending` or `succeeded` status effective date. The system
        replays the loan as if the payment never happened.

        It will also re-accrue interest since then.


        `inDispute` - payment is in dispute (typically because of chargeback).
        The payment is removed from the loan effective as of `initiated`,
        `pending` or `succeeded` status effective date. The system replays the
        loan as if the payment never happened.

        It will also re-accrue interest since then. Disputed payment can be for
        partial amount.


        `canceled` - payment or credit was canceled. Payment can be canceled
        only if the current status is `scheduled`.


        `chargeback` - payment was disputed and ruled against the lender. The
        payment was returned to the original payment instrument. Chargeback
        payment can be for partial amount.
      enum:
        - scheduled
        - initiated
        - pending
        - succeeded
        - failed
        - canceled
        - inDispute
        - chargeback
      type: string
    OneTimePaymentTransaction:
      allOf:
        - $ref: '#/components/schemas/BaseOneTimePaymentTransaction'
        - properties:
            consentDocumentId:
              allOf:
                - $ref: '#/components/schemas/AnyId'
                - description: >
                    The document ID of a one-time payment consent given by the

                    borrower to debit their payment instrument.  The document is

                    stored in the HTML format and contains the disclosure shown
                    to

                    the borrower at the time of the payment.  Required if

                    `previewMode=false` and Peach is processing payments (aka

                    `isExternal=false`) on behalf of the lender.
            drawId:
              description: >
                The draw identifier. If provided, the system will attempt to
                apply the payment to the specified draw. Any excess will be
                applied to

                the rest of LOC/Draws based on the multi-waterfall that is
                defined for the line of credit type.
              type: string
            effectiveDate:
              description: >
                The effective date of the transaction in the product timezone.


                For active loans (non-migrating), to create and backdate the
                transaction in one call:
                  1. Pass `effectiveDate` (today or in the past)
                  1. Pass `effectiveTimeOfDay` (see `effectiveTimeOfDay` for details)
                  1. Leave `scheduledDate` empty
                  1. Set `isExternal=true`
                  1. Set `status` to `succeeded` or `pending`

                The call triggers replay; use `sync=true` to wait for completion
                (408 on timeout)
                  - Note: `succeededAt` will equal `createdAt`, while `appliedAt` and `pendingAt` will equal
                    `effectiveDate` + `effectiveTimeOfDay`
                  - The transaction will appear on the next day's loan tape (relative to the API call date in the product timezone)

                For migrating loans (`prepMigration`), the attribute is used
                during migration ingest only.
              format: date
              type: string
            effectiveTimeOfDay:
              allOf:
                - $ref: '#/components/schemas/TimeOfDay'
                - description: >
                    The effective time of day on `effectiveDate` in the product
                    timezone. Required if `effectiveDate` is passed.

                    For active loans with external payments, required together
                    with `effectiveDate` for single-call backdating.


                    Note: for migration only (`prepMigration`), the value must
                    be after 2AM in the product timezone.
                  type: object
                  writeOnly: true
            enablePrepayments:
              description: >
                **DEPRECATED ATTRIBUTE**

                `true` if the borrower opts to apply any overpayment amount to
                prepayment of future obligations.

                `false` if the borrower opts to apply overpayments to the
                current obligation.


                If this field is not passed, we reference the `allowPrepayments`
                configuration on the loan type.
              type: boolean
            holdDaysEndDate:
              $ref: '#/components/schemas/HoldDaysEndDate'
            isExternal:
              description: >-
                A transaction marked `isExternal=true` is for record purposes
                only. A transaction with an external `paymentInstrument` is
                automatically marked external.
              type: boolean
            scheduledDate:
              description: >
                This attribute should be used only for transactions that are
                scheduled in the future. Transactions that should be processed
                now/today,

                leave the attribute empty and the system will set appropriate
                date and timestamp values based on the API call time.


                Note: The maximum date you can set is the maximum of either
                three years after the last expected payment or three years from
                today.
              format: date
              type: string
            status:
              $ref: '#/components/schemas/TransactionCreationStatus'
          type: object
        - $ref: '#/components/schemas/CaseId'
      required:
        - paymentInstrumentId
        - amount
        - type
      title: One Time Payment
    ServiceCreditTransaction:
      allOf:
        - $ref: '#/components/schemas/BaseServiceCreditTransaction'
        - properties:
            drawId:
              description: >
                The draw identifier. If provided, the system will attempt to
                apply the payment to the specified draw. Any excess will be
                applied to

                the rest of LOC/Draws based on the multi-waterfall that is
                defined for the line of credit type.
              type: string
            effectiveDate:
              description: >
                The effective date of the service credit in the product
                timezone.


                On active (non-migrating) loans, use with `effectiveTimeOfDay`
                and without `scheduledDate` to create and

                backdate in one call (date must be today or in the past).
                Triggers replay; use `sync=true` to wait for

                completion (408 on timeout). `effectiveTimeOfDay` is required
                when this field is passed.


                On migrating loans (`prepMigration`), used during migration
                ingest only.
              format: date
              type: string
              writeOnly: true
            effectiveTimeOfDay:
              allOf:
                - $ref: '#/components/schemas/TimeOfDay'
                - description: >
                    The effective time of day on `effectiveDate` in the product
                    timezone. Required if `effectiveDate` is passed.

                    For active loans, required together with `effectiveDate` for
                    single-call backdating.


                    Note: for migration only (`prepMigration`), the value must
                    be after 2AM in the product timezone.
                  type: object
                  writeOnly: true
            enablePrepayments:
              description: >
                **DEPRECATED ATTRIBUTE**

                `true` if the borrower opts to apply any overpayment amount to
                prepayment of future obligations.

                `false` if the borrower opts to apply overpayments to the
                current obligation.

                If this field is not passed, we reference the `allowPrepayments`
                configuration on the loan type.
              type: boolean
            scheduledDate:
              description: >
                This attribute should be used only for transactions that need to
                be applied now/today or are scheduled in the future.

                Transactions that should be processed now/today, leave the
                attribute empty and the system

                will set appropriate date and timestamp values based on the API
                call time.

                If a future date is provided, the service credit will be
                scheduled for the future date and

                won't be applied to the ledger until then.


                To apply a service credit with an effective date in the past on
                an active loan, pass `effectiveDate` and

                `effectiveTimeOfDay` with an empty `scheduledDate` (single-call
                backdate; triggers replay).


                Note: The maximum date you can set is the maximum of either
                three years after the last expected payment or three years from
                today.
              format: date
              type: string
          type: object
        - $ref: '#/components/schemas/CaseId'
      required:
        - serviceCreditType
        - serviceCreditSponsor
        - amount
        - type
      title: Service Credit
    serviceCreditTypesForCreate:
      enum:
        - serviceAgent
        - serviceSupervisor
        - settlementOfDebt
        - settlementOfDebtNoLoss
        - balanceTransfer
        - rewards
        - fraud
        - badDebt
        - bankruptcy
        - deceased
        - usuryCap
      type: string
    ServiceCreditTransactionForCreate:
      allOf:
        - $ref: '#/components/schemas/ServiceCreditTransaction'
        - properties:
            serviceCreditType:
              $ref: '#/components/schemas/serviceCreditTypesForCreate'
          type: object
      title: Service Credit
    DownPaymentTransaction:
      allOf:
        - $ref: '#/components/schemas/BaseDownPaymentTransaction'
        - properties:
            consentDocumentId:
              allOf:
                - $ref: '#/components/schemas/AnyId'
                - description: >
                    The document ID of a one-time payment consent given by the

                    borrower to debit their payment instrument.  The document is

                    stored in the HTML format and contains the disclosure shown
                    to

                    the borrower at the time of the payment.  Required if

                    `previewMode=false` and Peach is processing payments (aka

                    `isExternal=false`) on behalf of the lender.
            drawId:
              description: >
                The draw identifier. If provided, the system will attempt to
                apply the payment to the specified draw. Any excess will be
                applied to

                the rest of LOC/Draws based on the multi-waterfall that is
                defined for the line of credit type.
              type: string
            effectiveDate:
              description: >
                The effective date of the transaction in the product timezone.


                On active (non-migrating) loans, use with `effectiveTimeOfDay`
                and without `scheduledDate` to create and

                backdate in one call (`isExternal=true`, status `succeeded` or
                `pending`; date must be today or in the past).

                Triggers replay; use `sync=true` to wait for completion (408 on
                timeout). `effectiveTimeOfDay` is required when

                this field is passed.


                On migrating loans (`prepMigration`), used during migration
                ingest only.
              format: date
              type: string
            effectiveTimeOfDay:
              allOf:
                - $ref: '#/components/schemas/TimeOfDay'
                - description: >
                    The effective time of day on `effectiveDate` in the product
                    timezone. Required if `effectiveDate` is passed.

                    For active loans with external payments, required together
                    with `effectiveDate` for single-call backdating.


                    Note: for migration only (`prepMigration`), the value must
                    be after 2AM in the product timezone.
                  type: object
                  writeOnly: true
            isExternal:
              description: >-
                A transaction marked `isExternal=true` is for record purposes
                only. A transaction with an external `paymentInstrument` is
                automatically marked external.
              type: boolean
            scheduledDate:
              description: >
                If provided must be a date in the future.


                Note: The maximum date you can set is the maximum of either
                three years after the last expected payment or three years from
                today.
              format: date
              type: string
            status:
              $ref: '#/components/schemas/TransactionCreationStatus'
          type: object
        - $ref: '#/components/schemas/CaseId'
      required:
        - paymentInstrumentId
        - amount
        - type
      title: Down Payment
    CreateTransaction:
      oneOf:
        - $ref: '#/components/schemas/OneTimePaymentTransaction'
        - $ref: '#/components/schemas/ServiceCreditTransactionForCreate'
        - $ref: '#/components/schemas/DownPaymentTransaction'
      required:
        - type
    TransactionUpdate:
      allOf:
        - $ref: '#/components/schemas/NormalTransaction'
        - properties:
            currency:
              readOnly: true
            isExternal:
              description: >
                **DEPRECATED ATTRIBUTE** Updating this field does not modify the
                transaction.


                A transaction marked `isExternal=true` is for record purposes
                only. A transaction with

                an external `paymentInstrument` is automatically marked
                external.
            isVirtual:
              description: >
                **DEPRECATED ATTRIBUTE** Updating this field does not modify the
                transaction.


                A transaction marked `isVirtual=true` is not a real transaction,
                but represents a part of another transaction.

                This is used to store the principal/interest split on draws in
                Line of Credits as well as splits between multiple

                installment loans that were applied as a single payment.
            paidFeesAmount:
              description: >
                **DEPRECATED ATTRIBUTE** Support for this field will be removed
                in the future.


                The paid amount allocated to fees
            paidInterestAmount:
              description: >
                **DEPRECATED ATTRIBUTE** Support for this field will be removed
                in the future.


                The paid amount allocated to interest
            paidOverAmount:
              description: >
                **DEPRECATED ATTRIBUTE** Support for this field will be removed
                in the future.


                Stores any excess amount that was not allocated to principal,
                interest or fees.
            paidPrincipalAmount:
              description: >
                **DEPRECATED ATTRIBUTE** Support for this field will be removed
                in the future.


                The paid amount allocated to principal
            paymentDetails:
              readOnly: true
            processorId:
              readOnly: true
            serviceCreditDetails:
              readOnly: true
            transactionType:
              readOnly: true
          type: object
    TransactionUpdateExternal:
      allOf:
        - $ref: '#/components/schemas/TransactionUpdate'
        - properties:
            timestamps:
              properties:
                effectiveDate:
                  readOnly: true
              type: object
          type: object
    LoanUnfreeze:
      allOf:
        - properties:
            previewMode:
              default: false
              description: >
                If `previewMode=true`, the loan doesn't change and no changes
                are saved to the database.
              type: boolean
            retroactivelyAccrueInterest:
              default: false
              description: >
                `true` to accrue interest (as usual) for periods occurring when
                the loan was frozen. `false` to make

                periodic payments occurring during the frozen period
                interest-free.
              type: boolean
            sendNotice:
              default: true
              description: >-
                When set to `false`, the system will NOT send a `loanUnfreeze`
                notice to the borrower.
              type: boolean
            shiftDueDates:
              default: false
              description: >
                `true` to defer the periodic payment amounts associated with
                periods that fall in the frozen period to one or

                more new periods generated at the end of a loan. `false` to keep
                the amounts in unfrozen periods.
              type: boolean
          type: object
        - $ref: '#/components/schemas/CaseId'
    fullAccountNumber:
      properties:
        accountNumber:
          description: >
            The full account number. Only provided if
            `showFullAccountNumber=true`.

            User must have the `payment.instrument:read.sensitive` permission to
            get the full number.
          type: string
      type: object
    PaymentCardImmutableFields:
      properties:
        cardNumberLastFour:
          description: >
            The last two, three or four digits of the card number.

            Normally, you should expect four digits. Two or three digits are
            returned when four digits are not available.
          example: '1111'
          readOnly: true
        cardType:
          description: >
            The type of card.


            - For external payment instruments, this field is required, and does
            not require additional permissions.


            - Otherwise, this field is not required, and using it requires
            permission `payment.instrument:force`.
          enum:
            - credit
            - debit
          type: string
        cvv:
          description: >
            The CVV, typically found on the back of the card.

            Peach does not save CVV and is only used to authenticate the card.
            Required if `isExternal=false`.
          example: '321'
          type: string
          writeOnly: true
        instrumentType:
          enum:
            - card
          type: string
        issuer:
          description: Issuing bank. Requires permission `payment.instrument:force`.
          type: string
        network:
          description: Card network. Requires permission `payment.instrument:force`.
          enum:
            - visa
            - mastercard
            - discover
            - americanExpress
          type: string
      type: object
    PaymentCardMutableFields:
      properties:
        address:
          allOf:
            - description: >
                The billing address associated with the card. If
                `isExternal=false`, then `postalCode` is required.
            - $ref: '#/components/schemas/AddressBase'
        expirationMonth:
          description: The expiration month of the card.
          example: 12
          type: integer
        expirationYear:
          description: The expiration year of the card.
          example: 2032
          type: integer
        firstName:
          description: First name on the card.
          type: string
        lastName:
          description: Last name on the card.
          type: string
      type: object
    PaymentCard:
      allOf:
        - $ref: '#/components/schemas/PaymentInstrumentImmutableFields'
        - $ref: '#/components/schemas/PaymentInstrumentFailureReasons'
        - $ref: '#/components/schemas/PaymentInstrumentMutableFields'
        - $ref: '#/components/schemas/PaymentCardImmutableFields'
        - $ref: '#/components/schemas/PaymentCardMutableFields'
      required:
        - instrumentType
        - cardNumber
        - expirationYear
        - expirationMonth
        - firstName
        - lastName
      title: Card
    fullCardNumber:
      properties:
        cardNumber:
          description: >
            The full card number. Also called PAN. Only provided if
            `showFullAccountNumber=true`.

            User must have the `payment.instrument:read.sensitive` permission to
            get the full number.
          type: string
      type: object
    PaymentCheckMutable:
      allOf:
        - $ref: '#/components/schemas/PaymentInstrumentMutableFields'
        - properties:
            accountHolderName:
              description: >
                For `personal` accounts, the full name of the account holder.
                For `business` accounts, the business name.


                <strong style="color: red">This is not an account nickname. It
                should match the name on file for the account with the
                bank.</strong>
              type: string
            accountHolderType:
              description: Type of entity that is the account holder.
              enum:
                - business
                - personal
              type: string
            address:
              $ref: '#/components/schemas/AddressBase'
              description: >
                The address on the check. Typically located in the top left
                corner, under the account holder name(s).
            payToTheOrderOfName:
              description: >
                The name of a person or organization designated to receive the
                funds,

                such as "John Smith" or "Peach Finance, Inc". Defaults to
                "Cash",

                used when you don't know the person or organization's exact
                name.
              type: string
          type: object
      title: Check
    PaymentCheck:
      allOf:
        - $ref: '#/components/schemas/PaymentInstrumentImmutableFields'
        - $ref: '#/components/schemas/PaymentInstrumentFailureReasons'
        - $ref: '#/components/schemas/PaymentInstrumentMutableFields'
        - properties:
            accountNumberLastFour:
              description: >
                The last two, three or four digits of the account number.

                Normally, you should expect four digits. Two or three digits are
                returned when four digits are not available.
              pattern: ^[0-9]{2,4}
              readOnly: true
              type: string
            checkNumber:
              description: >-
                The check sequence number. Typically located in the top right
                corner of the check.
              type: string
            institutionName:
              description: The name of the bank where this account resides.
              readOnly: true
              type: string
            instrumentType:
              enum:
                - check
              type: string
            routingNumber:
              description: The routing number.
              type: string
          type: object
        - $ref: '#/components/schemas/PaymentCheckMutable'
      required:
        - accountHolderName
        - accountHolderType
        - accountNumber
        - checkNumber
        - instrumentType
        - routingNumber
      title: Check
    Payroll:
      allOf:
        - $ref: '#/components/schemas/PaymentInstrumentImmutableFields'
        - $ref: '#/components/schemas/PaymentInstrumentMutableFields'
        - properties:
            departmentName:
              description: The department name.
              example: Accounting
              type: string
            employeeId:
              description: The employee/borrower ID in the payroll system.
              type: string
            employerName:
              description: The employer name.
              type: string
            instrumentType:
              enum:
                - payroll
              type: string
            isExternal:
              enum:
                - true
              readOnly: true
              type: boolean
            payFrequency:
              description: The payment frequency.
              enum:
                - weekly
                - everyTwoWeeks
                - twiceMonthly
                - monthly
              example: everyTwoWeeks
              type: string
            paySpecificDays:
              description: >
                The specific days on which paychecks are made. The allowed
                values for specific day(s) depends on the `payFrequency`.

                 - `weekly` - provide one number in the valid range 1-7. 1=Monday...7=Sunday.
                    For example: `[1]`.
                 - `everyTwoWeeks` - provide one number in the valid range 1-14.
                    First week: 1=Monday...7=Sunday.
                    Second week: 8=Monday...14=Sunday.
                    For example: `[1]`.
                 - `twiceMonthly` - provide two numbers in the valid range 1-31. 1=first day of a month. Use `31` to indicate the last day of a month.
                    For example: `[1, 15]` or `[15, 31]`.
                 - `monthly` - provide one number in the valid range 1-31. 1=first day of a month. Use `31` to indicate the last day of a month.
                    For example: `[1]`.
              example:
                - 1
                - 15
              items:
                type: integer
              type: array
            paycheckNetAmount:
              description: >-
                The amount of paycheck after taxes that is deposited to the
                borrower's bank account.
              example: 1024
              type: number
          type: object
      title: Payroll
    PaymentNetwork:
      allOf:
        - $ref: '#/components/schemas/PaymentInstrumentImmutableFields'
        - $ref: '#/components/schemas/PaymentInstrumentMutableFields'
        - properties:
            instrumentType:
              enum:
                - paymentNetwork
              type: string
            isExternal:
              enum:
                - true
              readOnly: true
              type: boolean
            paymentNetworkMemberId:
              description: The borrower identifier in the payment network system.
              type: string
            paymentNetworkName:
              description: The payment network name.
              type: string
          type: object
      title: Payment Network
    MoneyOrder:
      allOf:
        - $ref: '#/components/schemas/PaymentInstrumentImmutableFields'
        - $ref: '#/components/schemas/PaymentInstrumentMutableFields'
        - properties:
            institutionName:
              description: The name of the bank where this account resides.
              maxLength: 36
              type: string
            instrumentType:
              enum:
                - moneyOrder
              type: string
            isExternal:
              enum:
                - true
              readOnly: true
              type: boolean
            routingNumber:
              description: The routing number.
              pattern: \d{9}
              type: string
            serialNumber:
              description: The money order serial number.
              type: string
          type: object
      required:
        - instrumentType
        - serialNumber
      title: Money Order
    Wire:
      allOf:
        - $ref: '#/components/schemas/PaymentInstrumentImmutableFields'
        - $ref: '#/components/schemas/PaymentInstrumentMutableFields'
        - properties:
            institutionName:
              description: The name of the bank where this account resides.
              maxLength: 36
              type: string
            instrumentType:
              enum:
                - wire
              type: string
            isExternal:
              enum:
                - true
              readOnly: true
              type: boolean
            routingNumber:
              description: The routing number from where the wire was sent.
              pattern: \d{9}
              type: string
            wireNumber:
              description: The wire number. Must be unique.
              type: string
            wireType:
              default: domestic
              enum:
                - domestic
                - international
              type: string
          type: object
      required:
        - instrumentType
        - wireType
        - wireNumber
      title: Wire
    PaymentInstrumentGet:
      oneOf:
        - allOf:
            - $ref: '#/components/schemas/BankAccount'
            - $ref: '#/components/schemas/fullAccountNumber'
        - allOf:
            - $ref: '#/components/schemas/PaymentCard'
            - $ref: '#/components/schemas/fullCardNumber'
        - allOf:
            - $ref: '#/components/schemas/PaymentCheck'
            - $ref: '#/components/schemas/fullAccountNumber'
        - allOf:
            - required:
                - instrumentType
                - employerName
              type: object
            - $ref: '#/components/schemas/Payroll'
          title: Payroll
        - allOf:
            - required:
                - instrumentType
                - paymentNetworkName
              type: object
            - $ref: '#/components/schemas/PaymentNetwork'
          title: Payment Network
        - allOf:
            - $ref: '#/components/schemas/MoneyOrder'
            - $ref: '#/components/schemas/fullAccountNumber'
        - allOf:
            - $ref: '#/components/schemas/Wire'
            - $ref: '#/components/schemas/fullAccountNumber'
    hideFailureReason:
      properties:
        failureReason:
          readOnly: true
      type: object
    SendNoticePaymentMethodAdded:
      properties:
        sendNotice:
          default: true
          description: >
            When set to `true`, the system will send a `paymentMethodAdded`
            notice to the borrower.
          type: boolean
      type: object
    paymentCardCardNumber:
      properties:
        cardNumber:
          description: >
            The card number.

            If `isExternal=true` then only the last two, three, or four digits
            of the card number can be provided.

            Provide four digits if available, otherwise provide two or three
            digits.
          example: '4111111111111111'
          type: string
          writeOnly: true
      required:
        - cardNumber
      type: object
    paymentCheckAccountNumber:
      properties:
        accountNumber:
          description: >
            The account number.

            If `isExternal=true` then the last two, three, or four digits of the
            account number can be provided.

            Provide four digits if available, otherwise provide two or three
            digits.
          pattern: ^[0-9]+$
          type: string
          writeOnly: true
      required:
        - accountNumber
      type: object
    PlaidToken:
      example:
        accessToken: public-sandbox-deadbeef-dead-beef-dead-beefdeadbeef
        accountIds:
          - BnyjkeaawGiG7xgvV5noipAbVe6Edafwx3n97
        instrumentType: plaid
      properties:
        accessToken:
          description: >
            `public_token` provided by Plaid Link.


            **NOTE**: Plaid Link tokens are associated with a specific Plaid API
            key. If you are performing a Plaid Link in your app/website

            and pass it to the Peach API you will first need to set your Plaid
            API key in the Peach API. Please contact Peach Support

            to get access to the Plaid API Key setting endpoint and instructions
            on how to use it.


            If you wish to use your own Plaid Link token in the sandbox
            environment, please contact Peach Support as you might need

            to configure your Plaid sandbox account in a certain way.
          type: string
        accountIds:
          description: |
            List of Plaid account IDs selected by user, provided by Plaid Link
          items:
            type: string
          type: array
        externalId:
          description: >
            A lender's identifier for the instrument.


            After the object is successfully created, a lender can use ID or
            externalId identifiers to fetch the object.


            To fetch the object using externalId you need to add `ext-` to the
            URL.


            Note: Don't add ext- to the identifier value. For example: if the
            external identifier is `ABCDE`, then pass externalId=ACBCE and NOT
            ext-ABCDE when creating the object.
          minLength: 1
          nullable: true
          type: string
        instrumentType:
          enum:
            - plaid
          type: string
      required:
        - accessToken
        - accountIds
      title: Plaid Link
      type: object
    moneyOrderAccountNumber:
      properties:
        accountNumber:
          description: >
            The account number.

            If `isExternal=true` then the last two, three, or four digits of the
            account number can be provided.

            Provide four digits if available, otherwise provide two or three
            digits.
          pattern: ^[0-9]+$
          type: string
          writeOnly: true
      type: object
    wireAccountNumber:
      properties:
        accountNumber:
          description: >
            The account number from where the wire was sent. Must consist of
            only digits.

            If `isExternal=true` then the last two, three, or four digits of the
            account number can be provided.

            Provide four digits if available, otherwise provide two or three
            digits.
          pattern: ^[0-9]+$
          type: string
          writeOnly: true
      type: object
    PaymentInstrumentPost:
      discriminator:
        propertyName: instrumentType
      oneOf:
        - allOf:
            - $ref: '#/components/schemas/BankAccount'
            - $ref: '#/components/schemas/bankAccountAccountNumber'
            - $ref: '#/components/schemas/hideFailureReason'
            - $ref: '#/components/schemas/SendNoticePaymentMethodAdded'
        - allOf:
            - $ref: '#/components/schemas/PaymentCard'
            - $ref: '#/components/schemas/paymentCardCardNumber'
            - $ref: '#/components/schemas/hideFailureReason'
            - $ref: '#/components/schemas/SendNoticePaymentMethodAdded'
        - allOf:
            - $ref: '#/components/schemas/PaymentCheck'
            - $ref: '#/components/schemas/paymentCheckAccountNumber'
            - $ref: '#/components/schemas/hideFailureReason'
        - allOf:
            - required:
                - instrumentType
                - employerName
              type: object
            - $ref: '#/components/schemas/Payroll'
            - $ref: '#/components/schemas/hideFailureReason'
            - $ref: '#/components/schemas/SendNoticePaymentMethodAdded'
          title: Payroll
        - allOf:
            - required:
                - instrumentType
                - paymentNetworkName
              type: object
            - $ref: '#/components/schemas/PaymentNetwork'
            - $ref: '#/components/schemas/hideFailureReason'
            - $ref: '#/components/schemas/SendNoticePaymentMethodAdded'
          title: Payment Network
        - allOf:
            - $ref: '#/components/schemas/PlaidToken'
            - $ref: '#/components/schemas/BankAccountMutableFields'
            - $ref: '#/components/schemas/hideFailureReason'
            - $ref: '#/components/schemas/SendNoticePaymentMethodAdded'
            - properties:
                accountLink:
                  readOnly: true
                accountType:
                  readOnly: true
              type: object
          title: Plaid Account
        - allOf:
            - $ref: '#/components/schemas/MoneyOrder'
            - $ref: '#/components/schemas/moneyOrderAccountNumber'
            - $ref: '#/components/schemas/hideFailureReason'
        - allOf:
            - $ref: '#/components/schemas/Wire'
            - $ref: '#/components/schemas/wireAccountNumber'
            - $ref: '#/components/schemas/hideFailureReason'
    PaymentInstrument:
      oneOf:
        - $ref: '#/components/schemas/BankAccount'
        - $ref: '#/components/schemas/PaymentCard'
        - $ref: '#/components/schemas/PaymentCheck'
        - allOf:
            - required:
                - instrumentType
                - employerName
              type: object
            - $ref: '#/components/schemas/Payroll'
          title: Payroll
        - allOf:
            - required:
                - instrumentType
                - paymentNetworkName
              type: object
            - $ref: '#/components/schemas/PaymentNetwork'
          title: Payment Network
        - $ref: '#/components/schemas/MoneyOrder'
        - $ref: '#/components/schemas/Wire'
    SendNoticePaymentMethodUpdated:
      properties:
        sendNotice:
          default: true
          description: >
            When set to `true`, the system will send a `paymentMethodUpdated`
            notice to the borrower.
          type: boolean
      type: object
    PaymentCardMutable:
      allOf:
        - $ref: '#/components/schemas/PaymentInstrumentMutableFields'
        - $ref: '#/components/schemas/PaymentCardMutableFields'
      title: Card
    PaymentInstrumentMutable:
      anyOf:
        - allOf:
            - $ref: '#/components/schemas/BankAccountMutable'
            - $ref: '#/components/schemas/SendNoticePaymentMethodUpdated'
        - allOf:
            - $ref: '#/components/schemas/PaymentCardMutable'
            - $ref: '#/components/schemas/SendNoticePaymentMethodUpdated'
        - $ref: '#/components/schemas/PaymentCheckMutable'
        - allOf:
            - $ref: '#/components/schemas/Payroll'
            - $ref: '#/components/schemas/SendNoticePaymentMethodUpdated'
        - allOf:
            - $ref: '#/components/schemas/PaymentNetwork'
            - $ref: '#/components/schemas/SendNoticePaymentMethodUpdated'
    AccountLinkUpdate:
      properties:
        dataServices:
          default:
            - accountInfo
          description: A list of data services available with this link.
          items:
            enum:
              - accountInfo
              - balance
            type: string
          type: array
        lastErrorCommunicationAt:
          description: >-
            The date and time that the most recent error notification was sent
            to the user. When updated, `errorCommunicationsSent` is incremented.
          format: date-time
          type: string
      type: object
    AccountLinkBalanceEntry:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            availableBalanceAmount:
              description: >-
                Indicates the balance that is available to spend net of any
                pending transactions. This balance should be used for
                insufficient funds (NSF) prevention use case.
              format: float
              type: number
            createdAt:
              description: >-
                The date and time when this entry was fetched from the account
                link.
            currency:
              description: The currency used. Use ISO currency codes.
              type: string
            currentBalanceAmount:
              description: >-
                Indicates the current balance that does not take pending
                transactions into account.
              format: float
              type: number
            error:
              allOf:
                - description: >-
                    If present, details of the error returned from the account
                    link.
                - $ref: '#/components/schemas/AccountLinkError'
            lastSuccessfulBalance:
              description: >-
                The most recent balance data from a successful check. If the
                most recent balance check resulted in an error, this object is
                populated with last successfully fetched balances, if they
                exist.
              properties:
                availableBalanceAmount:
                  description: >-
                    Indicates the balance that is available to spend net of any
                    pending transactions. This balance should be used for
                    insufficient funds (NSF) prevention use case.
                  format: float
                  type: number
                createdAt:
                  description: >-
                    The date and time when this data was fetched from the
                    account link.
                  format: date-time
                  type: string
                currency:
                  description: The currency used. Use ISO currency codes.
                  type: string
                currentBalanceAmount:
                  description: >-
                    Indicates the current balance that does not take pending
                    transactions into account.
                  format: float
                  type: number
              type: object
          type: object
    VerificationAttempt:
      properties:
        createdAt:
          format: date-time
          readOnly: true
          type: string
        isSuccess:
          description: |
            `true` if this attempt to answer the questions was successful.
          readOnly: true
          type: boolean
      type: object
    VerificationQuestionCategory:
      description: >
        The category of questions to include.


        - `inBorrowerPortal` indicates the answer to this question can

        be found in the borrower portal.

        - `knownToBorrower` indicates the answer to this question

        is not found in borrower portal (and therefore must be known by the
        borrower).

        - `presetSecret` indicates the answer to this question was preconfigured
        by the borrower previously.
      enum:
        - inBorrowerPortal
        - knownToBorrower
        - presetSecret
      type: string
    VerificationQuestion:
      properties:
        category:
          $ref: '#/components/schemas/VerificationQuestionCategory'
        id:
          type: string
        memo:
          description: |
            The text of the memo for the agent
          type: string
        text:
          description: |
            The text of the question
          type: string
      type: object
    VerificationStatus:
      description: >
        The status of the verification.


        - `pending` - Verification is pending and answers can still be provided.

        - `succeeded` - Verification was successfully completed.

        - `failed` - Verification failed—the maximum number of answer attempts
        was reached.

        - `insufficientKnowledge` - Verification could not be created because
        there is not enough information about the person to generate questions.

        - `expired` - Verification timed out and was expired.
      enum:
        - failed
        - pending
        - succeeded
        - expired
        - insufficientKnowledge
      readOnly: true
      type: string
    Verification:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - description: >
            Object describes a borrower verification process. When a borrower
            initiates a phone call their

            identity should be verified before they are allowed to make changes
            to their account.
          properties:
            agentUserId:
              description: |
                An identifier of the agent performing the verification
              readOnly: true
              type: string
            attempts:
              description: >
                Represents the attempts to answer the questions associated with
                this borrower verification.

                The responses are intentionally not included for privacy and
                security. There can only be a maximum

                of `maxAttempts`. There can only be one successful attempt. A
                successful attempt is one with

                `isSuccess` set to `true`.
              items:
                $ref: '#/components/schemas/VerificationAttempt'
              readOnly: true
              type: array
            expiresAt:
              format: date-time
              readOnly: true
              type: string
            maxAttempts:
              description: >
                The maximum number of times an attempt can be made to answer all
                the questions. If `maxAttempts`

                are made without success, then this verification's status is set
                to `failed`.
              readOnly: true
              type: integer
            object:
              default: verification
              enum:
                - verification
              readOnly: true
              type: string
            personId:
              description: |
                An identifier of the borrower
              readOnly: true
              type: string
            questions:
              description: |
                The questions that were generated and must be answered.
              items:
                $ref: '#/components/schemas/VerificationQuestion'
              readOnly: true
              type: array
            status:
              $ref: '#/components/schemas/VerificationStatus'
              readOnly: true
          type: object
      title: verification
    VerificationsPaging:
      allOf:
        - $ref: '#/components/schemas/Paging'
        - properties:
            data:
              items:
                $ref: '#/components/schemas/Verification'
              type: array
          type: object
    VerificationPost:
      properties:
        verificationTypeId:
          description: >
            The ID of the borrower verification type to use when creating the
            verification.

            If `null`, then use the default borrower verification type.
          type: string
      type: object
    VerificationAttemptPost:
      properties:
        answers:
          description: >
            The list of answers to the questions for this verification. Ordering
            is not important, but the

            `questionId` must match the ID of the question to which the answer
            corresponds. *All* of the

            answers must match the stored information about the borrower in
            order for the verification

            to be successful.
          items:
            properties:
              questionId:
                description: |
                  The identifier for the question being answered.
                type: string
              text:
                description: >
                  The response text. This must match the stored information
                  about the user.

                  Different questions have different methods for matching the
                  response text. For instance, some

                  questions will match in a case-insensitive manner, or expect a
                  date-formatted string, or

                  allow for a few misspelled characters (e.g., in a name).
                type: string
            type: object
          type: array
      type: object
    Supercase:
      allOf:
        - $ref: '#/components/schemas/BaseWithExternalIdMixin'
        - properties:
            autoCreated:
              description: |
                True if the supercase was created by some automated method.
              type: boolean
            companyId:
              description: The company's ID
              readOnly: true
              type: string
            createdBy:
              $ref: '#/components/schemas/UserActionInfo'
              description: |
                Details of the user responsible for creating the supercase.
                Can be an agent or automated system process.
            description:
              description: |
                A description of the supercase and/or the precipitating event
                of the supercase.
              nullable: true
              type: string
            eventStartedAt:
              description: >
                The date and time at which the precipitating event took place.
                For instance, in the

                case of a bug, the earliest date at which the bug affected
                customers; in the case

                of a disaster, the date at which the disaster occurred.
              format: date-time
              nullable: true
              type: string
            femaDisasterDetails:
              description: The details of the associated FEMA disaster.
              nullable: true
              properties:
                beginDate:
                  description: Date the incident itself began.
                  format: date
                  nullable: true
                  type: string
                declarationDate:
                  description: |
                    Date the disaster was declared.
                  format: date
                  type: string
                description:
                  type: string
                endDate:
                  description: Date the incident itself ended.
                  format: date
                  nullable: true
                  type: string
                hmProgramDeclared:
                  description: >
                    Denotes whether the Hazard Mitigation program was declared
                    for this

                    disaster. For more information on the program,

                    please visit: www.fema.gov.
                  type: boolean
                iaProgramDeclared:
                  description: >
                    Denotes whether the Individual Assistance program was
                    declared

                    for this disaster. For more information on the program,

                    please visit: www.fema.gov.
                  type: boolean
                ihProgramDeclared:
                  description: >
                    Denotes whether the Individuals and Households program was
                    declared

                    for this disaster. For more information on the program,

                    please visit: www.fema.gov.
                  type: boolean
                impactedAreas:
                  items:
                    properties:
                      countyArea:
                        type: string
                      placeCode:
                        type: string
                      state:
                        type: string
                    type: object
                  type: array
                incidentType:
                  description: >
                    Type of incident such as fire or flood. The incident type
                    will

                    affect the types of assistance available. For more
                    information on

                    incident types, please visit: www.fema.gov.
                  maxLength: 100
                  type: string
                lastRefreshAt:
                  description: Date the record was last updated in the FEMA API data store.
                  format: date-time
                  nullable: true
                  type: string
                paProgramDeclared:
                  description: >
                    Denotes whether the Public Assistance program was declared
                    for this

                    disaster. For more information on the program,

                    please visit: www.fema.gov.
                  type: boolean
              readOnly: true
              type: object
            femaDisasterNumber:
              description: |
                The associated FEMA disaster number.
              type: integer
            femaMonitoringEndDate:
              description: |
                If set, the FEMA supercase monitoring will stop after this date.
              format: date
              nullable: true
              type: string
            name:
              description: Name of the supercase.
              maxLength: 128
              type: string
            object:
              default: supercase
              enum:
                - supercase
              readOnly: true
              type: string
            outcome:
              $ref: '#/components/schemas/ProcessOutcome'
            status:
              $ref: '#/components/schemas/ProcessStatus'
            statusUpdatedAt:
              description: >-
                The date and time at which the status was last updated on this
                supercase.
              format: date-time
              nullable: true
              readOnly: true
              type: string
            subcaseName:
              description: >
                The name of the subcase which will be used when creating new
                subcases for this supercase.
              nullable: true
              type: string
            subcaseTypeId:
              description: >
                The ID of the case-type which will be used when creating new
                subcases for this supercase.

                When a population is committed (by settings its `isDraft:
                false`) subcases of this type

                are created for all members of the population.


                Notes:

                - This is different from the `supercaseType`

                - This must be NOT null in order to commit a population.
              nullable: true
              type: string
            supercaseType:
              $ref: '#/components/schemas/SupercaseType'
          type: object
      description: >
        A supercase allows for the management of many subcases. It is useful,
        for

        instance, when there is an issue which effects a large group of
        borrowers.
    SupercaseCollection:
      items:
        $ref: '#/components/schemas/Supercase'
      type: array
    BulkSendRequestBody:
      properties:
        attachments:
          description: |
            An optional list of documents to attach to the outgoing email.
          items:
            description: A document descriptor ID.
            type: string
          type: array
        channel:
          $ref: '#/components/schemas/InteractionChannel'
        context:
          type: object
        isTransactional:
          type: boolean
        subject:
          $ref: '#/components/schemas/InteractionSubject'
        theme:
          $ref: '#/components/schemas/InteractionTheme'
      required:
        - subject
      type: object
    SupercaseBulkOperation:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            casesFailed:
              description: The number of cases on which the operation failed.
              type: integer
            casesIneligible:
              description: |
                The number of cases on which the operation could not succeed due
                to external factors. For example, if your operation requires the
                subcase to be open to have any meaningful effect, then a closed
                subcase would be considered ineligible.
              type: integer
            casesProcessed:
              description: The total number of processed and/or ineligible subcases.
              type: integer
            completed:
              description: Set to `true` if operation is completed.
              type: boolean
            createdBy:
              $ref: '#/components/schemas/UserActionInfo'
              description: |
                Details of the user responsible for creating the supercase.
                Can be an agent or automated system process.
            errorLog:
              description: List of error reports for each failed subcase level operations.
              items:
                type: object
              type: array
            finishedAt:
              description: The time operation finished.
              format: date-time
              type: string
            object:
              default: SupercaseBulkOperation
              enum:
                - SupercaseBulkOperation
              readOnly: true
              type: string
            startedAt:
              description: The time operation started.
              format: date-time
              type: string
            supercaseId:
              readOnly: true
              type: string
          type: object
        - anyOf:
            - properties:
                firstInteraction:
                  nullable: true
                  type: object
                noteId:
                  nullable: true
                  type: string
                operationType:
                  description: The different types of bulk operations.
                  enum:
                    - update
                  readOnly: true
                  type: string
                requestBody:
                  $ref: '#/components/schemas/CasePut'
                  description: The body of the bulk operation request
                  readOnly: true
              title: update
              type: object
            - properties:
                firstInteraction:
                  $ref: '#/components/schemas/Interaction'
                noteId:
                  nullable: true
                  type: string
                operationType:
                  description: The different types of bulk operations.
                  enum:
                    - sendMessage
                  readOnly: true
                  type: string
                requestBody:
                  $ref: '#/components/schemas/BulkSendRequestBody'
                  description: The body of the bulk operation request
                  readOnly: true
              title: sendMessage
              type: object
            - properties:
                firstInteraction:
                  nullable: true
                  type: object
                noteId:
                  nullable: true
                  type: string
                operationType:
                  description: The different types of bulk operations.
                  enum:
                    - createDoNotInteract
                  readOnly: true
                  type: string
                requestBody:
                  $ref: '#/components/schemas/DoNotInteract'
                  description: The body of the bulk operation request
                  readOnly: true
              title: createDoNotInteract
              type: object
            - properties:
                firstInteraction:
                  nullable: true
                  type: object
                noteId:
                  nullable: true
                  type: string
                operationType:
                  description: The different types of bulk operations.
                  enum:
                    - deleteDoNotInteract
                  readOnly: true
                  type: string
                requestBody:
                  nullable: true
                  readOnly: true
                  type: object
              title: deleteDoNotInteract
              type: object
            - properties:
                firstInteraction:
                  nullable: true
                  type: object
                noteId:
                  nullable: false
                  type: string
                operationType:
                  description: The different types of bulk operations.
                  enum:
                    - sendInstructionsByTask
                  readOnly: true
                  type: string
                requestBody:
                  $ref: '#/components/schemas/NoteRequest'
                  description: The body of the bulk operation request
                  readOnly: true
              title: sendInstructionsByTask
              type: object
    MemberBulkOperationResult:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            borrowerId:
              description: The ID of the borrower associated with this member
              readOnly: true
              type: string
            caseId:
              description: The ID of the subcase associated with this member
              readOnly: true
              type: string
            populationMembershipId:
              description: The ID of the population membership
              readOnly: true
              type: string
            status:
              description: The status of the bulk operation
              enum:
                - success
                - failed
                - notProcessed
              readOnly: true
              type: string
            supercaseBulkOperationId:
              description: Supercase bulk operation ID
              readOnly: true
              type: string
          type: object
      description: |
        A member bulk operation result represents the result of a bulk operation
        on a single member of a supercase population.
    TargetPopulation:
      allOf:
        - $ref: '#/components/schemas/BaseWithExternalIdMixin'
        - properties:
            populationId:
              description: The ID of the population
              readOnly: true
              type: string
            supercaseBulkOperationId:
              description: Supercase bulk operation ID
              readOnly: true
              type: string
          type: object
      description: >
        A target population represents a committed population that will be
        affected

        by the supercase bulk operation. Each supercase bulk operation would

        process one or more target populations.
    Population:
      allOf:
        - $ref: '#/components/schemas/BaseWithExternalIdMixin'
        - properties:
            companyId:
              description: The unique company identifier.
              readOnly: true
              type: string
            isDraft:
              description: |
                `True` if this is the draft population of the supercase.
              readOnly: true
              type: boolean
            object:
              default: population
              enum:
                - population
              readOnly: true
              type: string
            supercaseId:
              description: Identifier of the supercase that the population belongs to.
              readOnly: true
              type: string
          type: object
      description: >
        A supercase may affect many borrower-loans. A supercase population
        represents one instance

        of adding borrower-loans to a supercase. It's important to keep track of
        which borrower-loans

        were added at which time, because different actions may need to be taken
        depending on

        when a borrower-loan is added to a supercase.
    PopulationCollection:
      items:
        $ref: '#/components/schemas/Population'
      type: array
    PopulationMember:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            borrowerId:
              description: >
                The borrower ID of a borrower affected by this supercase.


                You must specify a borrower in addition to a loan because a loan
                might have multiple borrowers

                and only one of them might be affected by this supercase.
              type: string
            caseId:
              description: >-
                The ID of the subcase with which this borrower-loan is
                associated
              readOnly: true
              type: string
            createdBy:
              $ref: '#/components/schemas/UserActionInfo'
              description: |
                Details of the user responsible for creating the member.
                Can be an agent or automated system process.
            loanId:
              description: >
                The loan ID of a loan affected by this supercase. The loan must
                be associated with the

                specified borrower.
              nullable: true
              type: string
          type: object
    PopulationMemberCollection:
      items:
        $ref: '#/components/schemas/PopulationMember'
      type: array
    User:
      allOf:
        - $ref: '#/components/schemas/UserBasic'
        - properties:
            employee:
              allOf:
                - $ref: '#/components/schemas/Employee'
                - readOnly: true
            person:
              allOf:
                - $ref: '#/components/schemas/Borrower'
                  nullable: true
                - readOnly: true
          type: object
    UsersPaging:
      allOf:
        - $ref: '#/components/schemas/NewPaginator'
        - properties:
            data:
              items:
                $ref: '#/components/schemas/User'
              type: array
          type: object
    UserUpdate:
      allOf:
        - $ref: '#/components/schemas/UserBase'
        - properties:
            associatedPersonId:
              description: |
                **DEPRECATED ATTRIBUTE** Use `borrowerId`.

                The ID of the borrower to be associated with this user.
                Only applicable when `userType` is set to `borrower`.
              nullable: true
              type: string
            borrowerId:
              description: |
                The ID of the borrower to be associated with this user.
                Only applicable when `userType` is set to `borrower`.
              nullable: true
              type: string
            roles:
              description: |
                **DEPRECATED ATTRIBUTE** Use `roleIds`.

                List of role IDs to associate with this user upon creation.
              items:
                type: string
              nullable: true
              type: array
            userType:
              description: |
                **DEPRECATED ATTRIBUTE** Use `type`.
              enum:
                - borrower
                - agent
                - service
              type: string
          type: object
    UserCreate:
      allOf:
        - $ref: '#/components/schemas/UserUpdate'
        - properties:
            authType:
              properties:
                email:
                  type: string
                password:
                  type: string
                phone:
                  type: string
                samlSubjectNameId:
                  type: string
              type: object
          type: object
    NewPassword:
      properties:
        password:
          description: |
            The new password to use. Only applicable for `basic` auth.
          nullable: true
          type: string
      type: object
    NewEmailAuth:
      allOf:
        - properties:
            email:
              description: |
                The email address to use for the new auth.
              type: string
          required:
            - email
          type: object
        - $ref: '#/components/schemas/NewPassword'
    NewPhoneAuth:
      allOf:
        - properties:
            phone:
              description: |
                The phone number to use for the new auth.
              type: string
          required:
            - phone
          type: object
        - $ref: '#/components/schemas/NewPassword'
    NewSAMLAuth:
      allOf:
        - properties:
            samlSubjectNameId:
              description: |
                The SAML subject name ID to use for the new auth.
              type: string
          required:
            - samlSubjectNameId
          type: object
        - $ref: '#/components/schemas/NewPassword'
    NewAuth:
      oneOf:
        - $ref: '#/components/schemas/NewEmailAuth'
        - $ref: '#/components/schemas/NewPhoneAuth'
        - $ref: '#/components/schemas/NewSAMLAuth'
    Permission:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - description: >
            A permission is assigned to a role, which allows designated users
            within a company to perform an action
          properties:
            action:
              description: The name of the handler function that is allowed
              type: string
            companyId:
              description: Unique ID for the company that owns the permission
              type: string
          title: permission
          type: object
    Role:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - description: >
            A role is a collection of permitted actions that can be performed by
            a user within the context of a single

            company.
          properties:
            alias:
              description: An optional Human-readable instance name
              maxLength: 100
              minLength: 0
              nullable: true
              type: string
            companyId:
              description: Company that the role is associated with
              readOnly: true
              type: string
            isSuperAdmin:
              description: >
                Whether this role has super-admin status. Only super-admin roles
                can hold super-admin permissions.

                Super-admin roles are reserved for Peach.
              readOnly: true
              type: boolean
            permissions:
              description: Array of Permission objects associated with the role
              items:
                $ref: '#/components/schemas/Permission'
              nullable: true
              readOnly: true
              type: array
          type: object
    RoleCollection:
      allOf:
        - $ref: '#/components/schemas/Paging'
        - properties:
            data:
              items:
                $ref: '#/components/schemas/Role'
              type: array
          type: object
    VerificationQuestionsPaging:
      allOf:
        - $ref: '#/components/schemas/Paging'
        - properties:
            data:
              items:
                $ref: '#/components/schemas/VerificationQuestion'
              type: array
          type: object
    VerificationType:
      description: |
        The object describing how to perform borrower verifications
      properties:
        enabledQuestionIds:
          description: >
            List of question IDs the system will consider when randomly
            selecting questions

            for verification; if `null` then all available questions will be
            considered.

            (<a
            href="/api-docs/api-public/verification-types/peach.borrower_verification.handlers.borrower_verification_questions_get_all">See
            all available questions</a>).
          items:
            type: string
          nullable: true
          type: array
        expirationInSecs:
          default: 900
          description: >
            How many seconds each verification session has until it is marked as
            expired.
          type: integer
        id:
          readOnly: true
          type: string
        maxAttemptsPerSession:
          default: 3
          description: >
            The number of attempts to answer the verification questions a
            borrower is allowed.
          type: integer
        maxSessionsRecentPast:
          default: 2
          description: >
            Throttles maximum verification sessions a borrower can initiate
            within

            "the recent past". Where recent past time length is configured via
            `recentPastSecs`.
          type: integer
        questionSelectionCriteria:
          description: >
            Object describing which and how many questions (at a minimum) to
            select at random.

            (Only questions with IDs present in `enabledQuestionIds` will be
            considered.)
          items:
            properties:
              category:
                $ref: '#/components/schemas/VerificationQuestionCategory'
              exactMatchCount:
                description: |
                  The number of questions matching this type to include.
                type: integer
            type: object
          type: array
        recentPastSecs:
          default: 3600
          description: >
            The number of seconds into the past which is considered the "recent
            past"

            for the purposes of throttling verifications. See:
            `maxSessionsRecentPast`.
          type: integer
      type: object
    VerificationTypesPaging:
      allOf:
        - $ref: '#/components/schemas/NewPaginator'
        - properties:
            data:
              items:
                $ref: '#/components/schemas/VerificationType'
              type: array
          type: object
    eventTypesPublic:
      enum:
        - autopay.schedule.cancel
        - autopay.schedule.changed
        - autopay.schedule.created
        - autopay.payment.canceled
        - autopay.payment.rescheduled
        - card.created
        - card.replacement.requested
        - card.status.changed
        - case.association.added
        - case.association.removed
        - case.donotinteract.created
        - case.donotinteract.deleted
        - case.donotinteract.updated
        - case.donotinteract.changed
        - case.donotinteract.expired
        - case.escalation.changed
        - case.created
        - case.updated
        - case.deleted
        - case.changed
        - template.descriptor.changed
        - template.version.changed
        - template.version.activated
        - communication.send
        - indexrate.created
        - indexrate.updated
        - loan.closed
        - loan.created
        - loan.current
        - loan.fee.capitalized
        - loan.credit.limit.changed
        - draw.credit.limit.changed
        - draw.fee.booked
        - loan.balance.changed
        - loan.foreigntransactionfee.booked
        - loan.overdue
        - loan.overdue.update
        - loan.interestaccrued.min
        - loan.interest.capitalized
        - loan.statuschanged
        - loan.latefee.booked
        - loan.migration.succeeded
        - loan.migration.failed
        - loan.modificationfee.booked
        - loan.nsffee.booked
        - loan.fee.booked
        - loan.fee.canceled
        - loan.fee.changed
        - loan.label.added
        - loan.label.removed
        - loan.remainingbalances.deferred
        - loan.promoprogram.activated
        - loan.promoprogram.canceled
        - loan.promoprogram.created
        - loan.promoprogram.exercised
        - loan.promoprogram.reactivated
        - loan.promoprogram.updated
        - loan.paymentplan.setup
        - loan.promiseplan.created
        - loan.promiseplan.statuschanged
        - loan.promiseplan.due.today
        - loan.promiseplan.overdue
        - loan.promiseplan.current
        - loan.purchasefee.booked
        - loan.duedate.defer
        - loan.schedule.defer
        - loan.ownerchanged
        - loan.rate.created
        - loan.rate.updated
        - loan.refunded
        - loan.reimbursement.initiated
        - loan.reimbursement.processed
        - loan.period.started
        - loan.obligation.statuschanged
        - loan.servicefee.booked
        - loan.membershipfee.booked
        - statement.created
        - paymentplan.created
        - paymentplan.statuschanged
        - person.created
        - person.consent.updated
        - person.monitoring.scra.started
        - person.monitoring.bankruptcy.started
        - contact.created
        - contact.deleted
        - contact.updated
        - payment.instrument.created
        - payment.instrument.updated
        - payment.instrument.deactivated
        - interaction.blocked
        - payment.applied
        - payment.chargeback
        - payment.chargeback.reversed
        - payment.failed
        - payment.initiated
        - payment.pending
        - payment.succeeded
        - payment.reversed
        - payment.scheduled
        - payment.rescheduled
        - payment.due.today
        - payment.hold.days.expired
        - purchase.authorized
        - purchase.settled
        - purchase.applied
        - purchase.changed
        - purchase.created
        - purchase.dispute.created
        - purchase.dispute.updated
        - loan.creditreporting.created
        - loan.creditreporting.stopped
        - ach.file.created
        - ach.file.upload.attempted
        - ach.file.upload.failed
        - ach.file.upload.succeeded
        - reconciliation.payment.failed
        - supercase.changed
    WebhookDirectDetails:
      description: >
        The details required for Peach to pass the events via webhook. Required
        only if `webhookType=direct`.
      properties:
        webhookUrl:
          description: |
            The URL that Peach will hit when an applicable event fires.
          type: string
      type: object
    WebhookProxyDetails:
      description: >
        The details required for Peach to make an API call to the third party
        identified in the `webhookType`.

        Required only if `webhookType=proxyXXX`.
      properties:
        galileoApiLogin:
          description: |
            The Galileo API login needed to make API calls via Peach's proxy.
          type: string
          writeOnly: true
        galileoApiTransKey:
          description: |
            The Galileo API key needed to make API calls via Peach's proxy.
          type: string
          writeOnly: true
        galileoBaseUrl:
          description: The Galileo base URL.
          type: string
        galileoProviderId:
          description: The Galileo provider ID.
          type: string
      type: object
    WebhookSubscriptionPut:
      allOf:
        - $ref: '#/components/schemas/BaseMixin'
        - properties:
            companyId:
              description: |
                The unique company identifier.
              readOnly: true
              type: string
            enabled:
              default: true
              description: >-
                If `true` events will be sent to this webhook, if `false` no
                events will be sent to it.
              type: boolean
            hmacSecretKey:
              description: >
                This automatically generated key will be used to compute the
                message signature of each request from Peach to

                authenticate the message and validate the message's integrity.
                Peach uses SHA-256 to generate the message signature,

                which will be passed in the request via a header called
                `X-PEACH-HMAC`.
              readOnly: true
              type: string
            hydrateData:
              default: false
              description: >
                Indicates the amount of information the receiver of webhooks
                will get. Only applicable if `webhookType=direct`.

                - `false` - Peach will provide a minimum amount of data. For
                example: event identifier, event name, timestamp and
                  identifier(s) of associated object(s) (e.g. loan ID, borrower ID, transaction ID, etc.)
                - `true` - in addition to the data provided in the `false`
                option, Peach will provide full details of the object(s)
                  associated with the event.

                Currently we support hydrating the following objects:
                  - `borrower`
                  - `loan`
                  - `transaction`
                  - `case`
              type: boolean
            webhookDirectDetails:
              $ref: '#/components/schemas/WebhookDirectDetails'
            webhookProxyDetails:
              $ref: '#/components/schemas/WebhookProxyDetails'
          type: object
    WebhookSubscription:
      allOf:
        - properties:
            eventTypes:
              description: >
                The list of events for which the caller will receive webhooks.

                For any proxy `webhookType`, this field should be left empty,
                and we will automatically send the events

                associated with that specific proxy.
              items:
                allOf:
                  - $ref: '#/components/schemas/eventTypesPublic'
                  - type: string
              type: array
            webhookType:
              description: >
                Peach supports two ways of receiving webhooks:

                - `direct` - events will be provided directly to the url
                nominated by the lender, and the event data will match Peach's
                data format.

                - `proxyGalileo` - events will trigger Peach to make specific
                API calls to Galileo, so Galileo's sub-ledger remains in sync
                with Peach's ledger.


                Note: when setting webhookType as `proxyGalileo`, please work
                with the Peach team to ensure the API calls you require are
                configured.
              enum:
                - direct
                - proxyGalileo
              type: string
          type: object
        - $ref: '#/components/schemas/WebhookSubscriptionPut'
  responses:
    CaseEscalationDetailedPaging:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/CaseEscalationDetailed'
                    type: array
                type: object
      description: Success
    Amortize:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/AmortizationResult'
                type: object
      description: Success
    TemporaryTokenResponse:
      content:
        application/json:
          schema:
            properties:
              data:
                properties:
                  exchangeToken:
                    description: >-
                      A random token that may be exchanged for a real token via
                      the `/auth/token` endpoint
                    type: string
                type: object
            type: object
      description: Success
    SingletonResponse:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SingletonResponse'
      description: Success
    UserPermissions:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - $ref: '#/components/schemas/UserPermissions'
      description: Success
    JWT:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthSuccess'
      description: JWT token
    UserInfo:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserInfo'
      description: Success
    BulkSenderList:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/NewPaginator'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/BulkSender'
                    type: array
                type: object
      description: success
    BulkSender:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/BulkSender'
                type: object
      description: success
    ContactExporterList:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/NewPaginator'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/ContactExporter'
                    type: array
                type: object
      description: success
    ContactExporter:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/ContactExporter'
                type: object
      description: success
    BorrowerCampaignList:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/NewPaginator'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/BorrowerCampaignFull'
                    type: array
                type: object
      description: Success
    BorrowerCampaign:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/BorrowerCampaignFull'
                type: object
      description: Success
    BorrowerCampaignRun:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BorrowerCampaignRun'
      description: Success
    CardIssuerPagingResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/CardIssuer'
                    type: array
                type: object
      description: Success
    CardIssuerResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/CardIssuer'
                type: object
      description: Success
    CaseTypesPaging:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/CaseType'
                    type: array
                type: object
      description: Success
    CaseType:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/CaseType'
                type: object
      description: Success
    NoContent:
      description: Success no content
    SmartReviewsTasksCreated:
      content:
        application/json:
          schema:
            properties:
              data:
                properties:
                  caseTypeId:
                    description: Case type this task creation run was performed on
                    type: string
                  completedAt:
                    format: date-time
                    type: string
                  createdTasks:
                    properties:
                      count:
                        description: Number of reminder tasks created
                        type: number
                      taskLog:
                        additionalProperties:
                          example:
                            CE-XXXX-XXXX:
                              caseValue: '2023-07-31T19:07:00Z'
                              creatingRule: keyDates.importantDate
                          properties:
                            caseValue:
                              description: >-
                                The value on the case that triggered task
                                creation
                            creatingRule:
                              description: >-
                                The smart reviews rule that triggered task
                                creation
                              type: string
                          type: object
                        type: object
                    type: object
                  smartReviewsConfig:
                    description: |
                      Smart reviews configuration for the case type as of the
                      task creation run
                    type: object
                type: object
            type: object
      description: Run successful with created reminder tasks
    CasesPaging:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/NewPaginator'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/Case'
                    type: array
                type: object
      description: Success
    CollectionAgencyPagingResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/CollectionAgency'
                    type: array
                type: object
      description: Success
    CollectionAgencyResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/CollectionAgency'
                type: object
      description: Success
    CreditAgencyPagingResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/CreditAgency'
                    type: array
                type: object
      description: Success
    CreditAgencyResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/CreditAgency'
                type: object
      description: Success
    BadRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Bad request
    NotFoundError:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Not found
    CallSummaryResultsPaging:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CallSummaryResultsPaging'
      description: Success
    InteractionsManyNoPaging:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InteractionsManyNoPaging'
      description: Success
    LoanLabelPagingResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/NewPaginator'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/LoanLabel'
                    type: array
                type: object
      description: Success
    LoanLabelResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/LoanLabel'
                type: object
      description: Success
    LoanIdsResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/LoanIdsResponse'
                type: object
      description: Success
    LoanTapeTypePagingResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/TapeType'
                    type: array
                type: object
      description: Success
    LoanTapeTypeResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/TapeType'
                type: object
      description: Success
    LoanTapePagingResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/LoanTape'
                    type: array
                type: object
      description: Success
    LoanTapeResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/LoanTape'
                type: object
      description: Success
    LoanTapeGeneratePostResponse:
      content:
        application/json:
          schema:
            allOf:
              - properties:
                  data:
                    items:
                      properties:
                        loanTapeId:
                          type: string
                        operationId:
                          type: string
                        reportDate:
                          format: date
                          type: string
                      type: object
                    type: array
                  status:
                    type: integer
                type: object
      description: Success
    LoanTapeRecordPagingResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/LoanTapeRecord'
                    type: array
                type: object
      description: Success
    PromiseToPayPlan:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/PromiseToPayPlan'
                type: object
      description: Promise to pay plan
    MerchantPagingResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    $ref: '#/components/schemas/Merchant'
                type: object
      description: Success
    MerchantResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/Merchant'
                type: object
      description: Success
    PromoProgramTypePaging:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PromoProgramTypePaging'
      description: Success
    PromoProgramType:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/PromoProgramTypeFields'
                type: object
      description: Success
    TaskWorkerPairingConfigPaging:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TaskWorkerPairingConfigPaging'
      description: Success
    TaskWorkerPairingConfig:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/TaskWorkerPairingConfig'
                type: object
      description: Success
    TaskQueueData:
      content:
        application/json:
          schema:
            items:
              $ref: '#/components/schemas/TaskQueueData'
            type: array
      description: Success
    CodeCollection:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CodePaging'
      description: Codes
    GetCode:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/Code'
                type: object
      description: Code
    CodeExecution:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/CodeExecution'
                type: object
      description: Code Execution Result
    DoNotInteractTypesPaging:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/DoNotInteractType'
                    type: array
                type: object
      description: Success
    DoNotInteractType:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/DoNotInteractType'
                type: object
      description: Success
    EmployeesPaging:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/NewPaginator'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/Employee'
                    type: array
                type: object
      description: Success
    Employee:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/Employee'
                type: object
      description: Success
    EmailSignature:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/EmailSignature'
                type: object
      description: Success
    EventsPublic:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/NewPaginator'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/EventPublic'
                    type: array
                type: object
      description: Success
    InteractionsPaging:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InteractionsPaging'
      description: Success
    Interaction:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/Interaction'
                type: object
      description: Success
    Note:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/NoteResponse'
                type: object
      description: Success
    200ReturnUrl:
      content:
        application/json:
          schema:
            properties:
              url:
                format: uri
                type: string
            type: object
      description: >-
        If the `returnUrl` parameter is `true` then return the url rather than
        redirecting.
    302DownloadRecordedContents:
      description: Redirected to the recorded content
    IndexRatePaging:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/IndexRatePaging'
      description: Success
    IndexRateResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/IndexRateResult'
                type: object
      description: Success
    NotificationTypesPaging:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/NotificationType'
                    type: array
                type: object
      description: Success
    NotificationType:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/NotificationType'
                type: object
      description: Success
    PersonPaging:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BorrowerPaging'
      description: Success
    Person:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/Borrower'
                type: object
      description: Success
    PersonSearchPaging:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PersonSearchPaging'
      description: Success
    PersonNoIdentity:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/BorrowerNoIdentity'
                type: object
      description: Success
    CanInteract:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/InteractionCanInteractResult'
                type: object
      description: Success
    Case:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/Case'
                type: object
      description: Success
    DoNotInteractPaging:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/NewPaginator'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/DoNotInteract'
                    type: array
                type: object
      description: Success
    DoNotInteract:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/DoNotInteract'
                type: object
      description: Success
    CaseEscalationPaging:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/CaseEscalation'
                    type: array
                type: object
      description: Success
    CaseEscalationDetailed:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CaseEscalationDetailed'
      description: Success
    Consent:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ConsentArray'
      description: Success
    ContactInformationPaging:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/NewPaginator'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/ContactInformation'
                    type: array
                type: object
      description: Success
    ContactInformation:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/ContactInformation'
                type: object
      description: Success
    IdentityPaging:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/IdentityPaging'
      description: Success
    Identity:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/Identity'
                type: object
      description: Success
    LegalRepresentativesPaging:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LegalRepresentativesPaging'
      description: Success
    LegalRepresentative:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/LegalRepresentative'
                type: object
      description: Success
    Loan:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/Loan'
                type: object
      description: Success
    LoanAccelerate:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/LoanAccelerateResponse'
                type: object
      description: Loan Accelerate
    LoanActivate:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/LoanActivationResponse'
                type: object
      description: Success
    Autopay:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/Autopay'
                type: object
      description: Success
    AutopayPut:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    allOf:
                      - $ref: '#/components/schemas/Autopay'
                      - $ref: '#/components/schemas/DeltaTerms'
                type: object
      description: Success
    AutopayPost:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    allOf:
                      - $ref: '#/components/schemas/Autopay'
                      - $ref: '#/components/schemas/DeltaTerms'
                type: object
      description: Success
    Balances:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/Balances'
                type: object
      description: Success
    LockedResponse:
      content:
        application/json:
          schema:
            properties:
              message:
                enum:
                  - Loan is locked for updates. Please try again.
                  - >-
                    Loan is locked for updates. Please check back again in a few
                    minutes.
                  - Previous purchase is processing.
                type: string
            type: object
      description: Locked
    CardPagingResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/Card'
                    type: array
                type: object
      description: Success
    CardResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/Card'
                type: object
      description: Success
    CardResponseWithPanAndCvv:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/CardWithPanAndCvv'
                type: object
      description: Success
    LoanChargeOff:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/LoanChargeOffResponse'
                type: object
      description: Loan Charge Off
    CollectionAgencyLoanDetailsResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/CollectionAgencyLoanDetailsGet'
                type: object
      description: Success
    CreditReportingStatusPagingResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    allOf:
                      - properties:
                          creditReportingDetails:
                            items:
                              $ref: '#/components/schemas/CreditReportingStatus'
                            type: array
                        type: object
                      - $ref: '#/components/schemas/LoanCreditReportingFields'
                type: object
      description: Success
    CreditReportingStatusResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/CreditReportingStatus'
                type: object
      description: Success
    LoanCustomPaymentPlans:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/CustomPaymentPlanResult'
                    type: array
                type: object
      description: Success
    LoanCustomPaymentPlan:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/CustomPaymentPlanResult'
                type: object
      description: Success
    LoanDeferDueDate:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    allOf:
                      - $ref: '#/components/schemas/LoanSchedule'
                      - $ref: '#/components/schemas/DueDateDeferralFeeAmount'
                      - $ref: '#/components/schemas/DeltaTerms'
                        description: >
                          If deferred due date is in the past, this will be
                          `null`, otherwise will be present.
                      - properties:
                          isLocked:
                            description: >
                              If true, the loan is in the middle of being
                              updated or replayed. The returned data are not
                              consistent. The caller should poll

                              on the `Get loan lock status` endpoint. Once
                              `isLocked` becomes `false`, the caller should call
                              GET /expected-payments again to get consistent
                              data.
                            type: boolean
                        type: object
                type: object
      description: Success
    LoanDeferSchedule:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    allOf:
                      - $ref: '#/components/schemas/LoanSchedule'
                      - $ref: '#/components/schemas/DueDateDeferralFeeAmount'
                      - $ref: '#/components/schemas/DeltaTerms'
                type: object
      description: Success
    PurchaseDisputePagingResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/PurchaseDispute'
                    type: array
                type: object
      description: Success
    DrawsPaging:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DrawsPaging'
      description: Success
    Draw:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/DrawResponse'
                type: object
      description: Success
    DrawActivate:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/DrawActivationResponse'
                type: object
      description: Success
    DynamicFeesAtOrigination:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/AtOriginationDynamicFees'
                type: object
      description: Success
    LoanEffectiveRatesResponse:
      content:
        application/json:
          schema:
            properties:
              data:
                properties:
                  effectiveRates:
                    items:
                      properties:
                        effectiveDate:
                          description: The effective date.
                          format: date
                          type: string
                        effectiveInterestRate:
                          description: >
                            The annual effective interest rate on the
                            `effectiveDate`.


                            For `interestType=spread` the value is calculated
                            as: `interestRate + indexRate - promoRate`. 

                            For `interestType=absolute` the value is calculated
                            as: `interestRate - promoRate`. 
                              
                            Additionally, the value cannot be negative, and
                            cannot be higher than the lowest rate cap for the
                            given date.
                          format: float
                          type: number
                        indexRate:
                          description: >
                            The annual interest index rate value for the
                            `effectiveDate`. Format is decimal. For example,
                            0.01 is 1% annual rate, 0.2 is 20% annual rate.
                          format: float
                          type: number
                        indexRateId:
                          description: >
                            The identifier of the index rate that is effective
                            on this date.
                          nullable: true
                          type: string
                        interestRate:
                          description: >
                            The annual net interest rate on the `effectiveDate`.
                            Format is decimal. For example, 0.01 is 1% annual
                            rate, 0.2 is 20% annual rate.

                            If two or more interest rates are `active` on the
                            same date (aka overlap), Peach system selects the
                            lowest rate (also called effective rate) to accrue
                            interest.
                          format: float
                          type: number
                        interestRateId:
                          description: >-
                            The identifier of the interest rate that is
                            effective on this date.
                          type: string
                        interestType:
                          description: >
                            The interest type. The interest type cannot be
                            changed after the loan status changes to
                            `originated` and onward. Interest rates defined as
                            `spread` will calculate an absolute rate by adding
                            the relative loan rate (aka spread) provided here to
                            the Index Interest Rate effective on the date the
                            interest is accrued. In case the Index Interest Rate
                            is not set, the system will assume that the Index
                            Interest Rate value is zero on the date the interest
                            is accrued.


                            Interest rates defined as `absolute` will use the
                            value as provided here without adding the Index
                            Interest Rate.
                          enum:
                            - absolute
                            - spread
                          type: string
                        promoRate:
                          description: >
                            The annual promo rate on the `effectiveDate`. Format
                            is decimal. For example, 0.01 is 1% annual rate, 0.2
                            is 20% annual rate.

                            If two or more promo rates are `active` on the same
                            date (aka overlap), Peach system sums up the rates
                            as "effective" promo rate.
                          format: float
                          type: number
                        promoRateIds:
                          description: >
                            The identifiers of the promo rates that are
                            effective on this date. 

                            (If two or more promo rates are `active` on the same
                            date, the

                            system sums the rates up to an "effective" promo
                            rate.)
                          items:
                            type: string
                          type: array
                        rateCap:
                          description: >
                            The rate cap value that was applied to limit the
                            effective interest rate.

                            This field contains the actual rate cap value (as a
                            decimal, e.g., 0.36 for 36%).
                          format: float
                          nullable: true
                          type: number
                        rateCapIds:
                          description: >
                            The public identifiers of the rate caps that are in
                            effect on this date.

                            (If two or more rate caps are `active` on the same
                            date, the

                            system uses the lowest rate cap.)
                          items:
                            pattern: ^RC-[A-Z0-9]{4}-[A-Z0-9]{4}$
                            type: string
                          type: array
                      title: effective rate
                      type: object
                    type: array
                type: object
            type: object
      description: Success
    ExpectedPayments:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    $ref: '#/components/schemas/ExpectedPaymentsResult'
                type: object
      description: Success
    FutureBalances:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/FutureBalances'
                type: object
      description: Success
    Obligations:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/ObligationsResult'
                type: object
      description: Success
    Obligation:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    allOf:
                      - $ref: '#/components/schemas/ObligationResult'
                      - $ref: '#/components/schemas/IsLocked'
                type: object
      description: Success
    PromoProgram:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/PromoProgramResult'
                type: object
      description: Success
    PromoProgramDelete:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/PromoProgramDeleteResult'
                type: object
      description: Success
    PurchaseDisputeResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/PurchaseDispute'
                type: object
      description: Success
    RateCapsArray:
      content:
        application/json:
          schema:
            items:
              $ref: '#/components/schemas/RateCap'
            type: array
      description: Success
    DrawNotFound:
      description: Loan or draw not found
    RateCap:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/RateCap'
                type: object
      description: Success
    responses-BadRequest:
      description: Bad request - validation error
    DrawRateCapNotFound:
      description: Loan, draw, or rate cap not found
    RateCapDeleted:
      content:
        application/json:
          schema:
            properties:
              message:
                example: Rate cap deleted successfully
                type: string
            type: object
      description: Success
    LoanRatesResponse:
      content:
        application/json:
          schema:
            properties:
              data:
                properties:
                  interestRates:
                    items:
                      $ref: '#/components/schemas/InterestRateResponse'
                    type: array
                  promoRates:
                    items:
                      $ref: '#/components/schemas/PromoRate'
                    type: array
                type: object
            type: object
      description: Success
    CreateOrUpdateInterestRatesResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    properties:
                      ratesValidation:
                        $ref: '#/components/schemas/InterestRateValidationAfterOrig'
                    type: object
                type: object
      description: Success
    ChangeSchedule:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    allOf:
                      - $ref: '#/components/schemas/ExpectedPaymentsResult'
                      - $ref: '#/components/schemas/DeltaTerms'
                type: object
      description: Success
    FeeNotCharged:
      content:
        application/json:
          schema:
            properties:
              message:
                description: The reason that the fee could not be charged.
                type: string
            type: object
      description: Fee not charged
    Interest:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    properties:
                      deferredInterestAccruedAmount:
                        description: >
                          The total deferred interest amount accrued between two
                          dates. If the deferred interest promotion is
                          exercised, the deferred interest 

                          is not expected to be paid. 
                        format: float
                        type: number
                      foregoneInterestCapAmount:
                        description: >
                          The amount of foregone interest that exceeded the
                          interest cap amount. This is only applicable to
                          installment loans with

                          `totalInterestCapAmount="true"` set atOrigination.
                        format: float
                        type: number
                      interestAccruedAmount:
                        description: The total interest amount accrued between two dates.
                        format: float
                        type: number
                      interestDiscountAmount:
                        description: >-
                          The amount of the interest discount between two dates
                          resulting from discounts, promotions, or other
                          adjustments.
                        format: float
                        type: number
                      netInterestAccruedAmount:
                        description: >-
                          The net interest amount accrued between two dates,
                          including adjustments for discounts and promotions.
                        format: float
                        type: number
                    type: object
                type: object
      description: Success
    LocChangeScheduleSCRA:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    allOf:
                      - $ref: '#/components/schemas/ExpectedPaymentsResult'
                type: object
      description: Success
    LOCObligations:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/LOCObligationsResult'
                type: object
      description: Success
    LOCObligation:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    allOf:
                      - $ref: '#/components/schemas/LOCObligationResult'
                      - $ref: '#/components/schemas/IsLocked'
                type: object
      description: Success
    ChangeScheduleSCRA:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    allOf:
                      - $ref: '#/components/schemas/ExpectedPaymentsResult'
                type: object
      description: Success
    LoanPeriodsResponse:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LoanPeriodsPaging'
      description: Loan Periods
    LoanPeriodResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/LoanPeriod'
                type: object
      description: Loan Period
    PromisetoPayPlansPaging:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/NewPaginator'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/PromiseToPayPlan'
                    type: array
                type: object
      description: Success
    PromoProgramPaging:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PromoProgramPaging'
      description: Success
    PurchasesPaging:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PurchasesPaging'
      description: Success
    LoanNotFound:
      description: Loan not found
    RateCapNotFound:
      description: Loan or rate cap not found
    LoanRefundCollection:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/LoanRefundCollectionResponse'
                type: object
      description: Loan Refund
    LoanRefundPost:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/LoanRefund'
                type: object
      description: Loan Refund
    LoanRefundV2Post:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/LoanRefundV2'
                type: object
      description: Loan Refund
    LoanReverseAccelerate:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/LoanReverseAccelerateResponse'
                type: object
      description: Loan Reverse Accelerate
    LoanReverseChargeOff:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/LoanReverseChargeOffResponse'
                type: object
      description: Loan Reverse Charge Off
    LoanScheduleOptions:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/LoanScheduleOptions'
                type: object
      description: Loan Schedule Options Get
    StatementCollection:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StatementsPaging'
      description: Collection of statements
    Statement:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/schemas-Statement'
                type: object
      description: A single Statement
    StatementDetails:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/StatementDetails'
                type: object
      description: Details for a single statement
    TransactionCollection:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TransactionsPaging'
      description: Collection of Transactions
    FailMultipleTransactions:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SingletonResponse'
      description: Succeeded
    Chargebacks:
      content:
        application/json:
          schema:
            properties:
              data:
                items:
                  $ref: '#/components/schemas/Chargeback'
                type: array
            type: object
      description: Chargebacks
    Chargeback:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/Chargeback'
                type: object
      description: Chargeback
    Transaction:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/Transaction'
                type: object
      description: A Transaction
    VerificationsPaging:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/VerificationsPaging'
      description: Success
    Verification:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/Verification'
                type: object
      description: Success
    SupercasePagingResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/NewPaginator'
              - properties:
                  data:
                    $ref: '#/components/schemas/SupercaseCollection'
                type: object
      description: Success
    SupercaseResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/Supercase'
                type: object
      description: Success
    BulkOperationResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    properties:
                      operationId:
                        description: The ID of the newly created bulk operation object
                        type: string
                    type: object
                type: object
      description: Accepted
    SupercaseDocumentsResponse:
      content:
        application/json:
          schema:
            oneOf:
              - description: |
                  List of document IDs to associated with the supercase.
                items:
                  description: A document descriptor ID.
                  type: string
                type: array
              - description: List of documents associated with the supercase.
                items:
                  $ref: '#/components/schemas/DocumentDescriptorResponse'
                type: array
      description: Success
    PopulationPagingResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    $ref: '#/components/schemas/PopulationCollection'
                type: object
      description: Success
    PopulationResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/Population'
                type: object
      description: Success
    PopulationMemberCollectionResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/PopulationMemberCollection'
                type: object
      description: Success
    PopulationMemberCollectionCSVResponse:
      content:
        application/octet-stream:
          schema:
            format: binary
            type: string
        text/csv:
          schema:
            format: binary
            type: string
      description: Success
    TeamsPaging:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/NewPaginator'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/Team'
                    type: array
                type: object
      description: Success
    Team:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/Team'
                type: object
      description: Success
    UsersPaging:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UsersPaging'
      description: Success
    User:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/User'
                type: object
      description: Success
    RolesPaging:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RoleCollection'
      description: Success
    VerificationQuestionsPaging:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/VerificationQuestionsPaging'
      description: Success
    VerificationTypesPaging:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/VerificationTypesPaging'
      description: Success
    VerificationType:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/VerificationType'
                type: object
      description: Success
    WebhookSubscriptionPagingResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Paging'
              - properties:
                  data:
                    items:
                      $ref: '#/components/schemas/WebhookSubscription'
                    type: array
                type: object
      description: Success
    WebhookSubscriptionResponse:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/SingletonResponse'
              - properties:
                  data:
                    $ref: '#/components/schemas/WebhookSubscription'
                type: object
      description: Success
x-tagGroups:
  - name: Frontend Integration
    tags:
      - Frontend
      - Frontend~~Internal
  - name: Authentication
    tags:
      - Auth
      - Auth~~Internal
      - API Keys
  - name: Borrower Management
    tags:
      - Borrowers
      - Borrowers~~Internal
      - Identity
      - Identity~~Internal
      - Contact Information
      - Contact Information~~Internal
      - Payment Instruments
      - Consent
      - Documents
      - Documents~~Internal
      - Legal Representation
      - Verifications
      - Verification Types
      - Monitoring Status~~Internal
      - Reassigned Numbers Database~~Internal
  - name: Campaign Management
    tags:
      - Campaign Overview
      - Campaigns
      - Campaigns~~Internal
      - Contact Exporters
      - Contact Exporters~~Internal
      - Bulk Senders
      - Bulk Senders~~Internal
  - name: Case Management
    tags:
      - Cases
      - Cases~~Internal
      - Case Types
      - Smart Reviews
      - Supercases
      - Do Not Interact
      - Do Not Interact Types
      - Notification Types
      - Notes
      - Workflows
      - Workflow Types
      - FEMA Disaster~~Internal
      - Tasks
      - Task-Worker Pairing Configs
      - AI Case Summarizer~~Internal
  - name: Loans Management
    tags:
      - Loans
      - Loan Types~~Internal
      - Installment Advances
      - Installment Refunds
      - Installment Refunds~~Internal
      - Line of Credit Draws
      - Line of Credit Purchases
      - Line of Credit Purchases~~Internal
      - Line of Credit Migration
      - Expected Payments
      - Obligations
      - Periods
      - Payment Plans
      - SCRA
      - Promise to Pay Plans
      - Fees
      - Dynamic Fee Type~~Internal
      - Rates
      - Rate Caps
      - Transactions
      - Statements
      - Autopay
      - Balances
      - Credit Reporting
      - Discount Programs
      - Settlements
      - LoansInvestors
      - Collection Agency
      - Loan Collection Agencies
      - Promo Programs
      - Monitoring Services~~Internal
      - Cards
      - Loan Labels
  - name: Communicator & Interactions
    tags:
      - Communicator
      - Communicator~~Internal
      - Templates
      - Templates~~Internal
      - System Documents & UI
      - System Sent Messages
      - Interactions
      - Compliance Guard
      - Compliance Guard~~Internal
  - name: Promo Programs Management
    tags:
      - Promo Programs Type
  - name: Processor Management
    tags:
      - Payment Processors
      - Card Issuers
      - Funding Instruments
      - ACH File~~Internal
  - name: Organization Management
    tags:
      - Employees
      - Teams
      - Users
      - Roles
      - Users~~Internal
      - Roles~~Internal
      - Permissions~~Internal
  - name: Capital Markets Management
    tags:
      - Investors
      - Settlement Instruments
      - Loan Tape Types
      - Loan Tapes
  - name: Merchants Management
    tags:
      - Merchants
  - name: Events and Webhooks Management
    tags:
      - Events
      - Events~~Internal
      - Webhooks
  - name: Utilities
    tags:
      - Loan Amortization
      - Routing Numbers
      - BIN Numbers
      - Index Rates
      - Operations
  - name: Credit Agencies Management
    tags:
      - Credit Agencies
  - name: Collection Agencies Management
    tags:
      - Collection Agencies
  - name: Errors
    tags:
      - Errors
